Files
@ c9f97be1927e
Branch filter:
Location: kallithea/scripts/run-all-cleanup
c9f97be1927e
189 B
text/plain
pygrack: refactor _get_fixedpath
This function strips the repository name and any slashes from the
URL path, leaving the protocol command, like info/refs or
git-{receive,upload}-pack.
Using .split() and .strip() for this purpose isn't entirely reliable
and is entirely unreadable, so it's better to write it out, even if
it's a bit verbose.
Also, error out in the unlikely case the path doesn't start with
a slash and the repository name; that shouldn't happen normally.
This function strips the repository name and any slashes from the
URL path, leaving the protocol command, like info/refs or
git-{receive,upload}-pack.
Using .split() and .strip() for this purpose isn't entirely reliable
and is entirely unreadable, so it's better to write it out, even if
it's a bit verbose.
Also, error out in the unlikely case the path doesn't start with
a slash and the repository name; that shouldn't happen normally.