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>

Jeff King committed Feb 8, 2017 at 15:52 UTC ece657f39939d067265eaf57e519a20019bcf794
1 file changed -2
transport.c
-2
@@ -1226,8 +1226,6 @@ static int refs_from_alternate_cb(struct alternate_object_database *e,
1226 return 0;
1227 len = strlen(other);
1228
1229 - while (other[len-1] == '/')
1230 - other[--len] = '\0';
1229 if (len < 8 || memcmp(other + len - 8, "/objects", 8))
1230 goto out;
1231 /* Is this a git repository with refs? */