summaryrefslogtreecommitdiff
path: root/transport.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2017-02-08 20:52:50 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-02-08 23:39:55 (GMT)
commitece657f39939d067265eaf57e519a20019bcf794 (patch)
tree2a2d9990ddb327306be07b1e7855a3e1bb46c377 /transport.c
parent3a1345af289703a04ff4754f9167ed3cfa2dfdce (diff)
downloadgit-ece657f39939d067265eaf57e519a20019bcf794.zip
git-ece657f39939d067265eaf57e519a20019bcf794.tar.gz
git-ece657f39939d067265eaf57e519a20019bcf794.tar.bz2
for_each_alternate_ref: stop trimming trailing slashes
The real_pathdup() function will have removed extra slashes for us already (on top of the normalize_path() done when we created the alternate_object_database struct in the first place). Incidentally, this also fixes the case where the path is just "/", which would read off the start of the array. That doesn't seem possible to trigger in practice, though, as link_alt_odb_entry() blindly eats trailing slashes, including a bare "/". Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'transport.c')
-rw-r--r--transport.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/transport.c b/transport.c
index 9ce0ee9..6fba9e9 100644
--- a/transport.c
+++ b/transport.c
@@ -1226,8 +1226,6 @@ static int refs_from_alternate_cb(struct alternate_object_database *e,
return 0;
len = strlen(other);
- while (other[len-1] == '/')
- other[--len] = '\0';
if (len < 8 || memcmp(other + len - 8, "/objects", 8))
goto out;
/* Is this a git repository with refs? */