URLs of the form https://github.com/user/repo/something/somethingelse
should redirect to https://github.com/user/repo/defaultbranch/something/somethingelse
if:
something
does not match a branch namesomething/somethingelse
exists indefaultbranch
URLs of the form https://github.com/user/repo/branch/something/somethingelse
should redirect to https://github.com/user/repo/branch/somethingnew
if:
something/somethingelse
else does not currently exist inbranch
something/somethingelse
exists in the history ofbranch
, and it has been renamed tosomethingnew