Changeset - c9f97be1927e
default
0
1
0
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.
1 file changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general)
0 comments (0 inline, 0 general)