summaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2016-10-03 16:36:26 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-10-10 13:52:37 -0700
commitea0fc3b4176a424a2b20eb76a6a503dc4d59cebb (patch)
treefcb3e3cc6bf9b74eaf5c1f7596701bb0a0135f3d /sha1_file.c
parentsha1_file: always allow relative paths to alternates (diff)
downloadtgif-ea0fc3b4176a424a2b20eb76a6a503dc4d59cebb.tar.xz
alternates: use fspathcmp to detect duplicates
On a case-insensitive filesystem, we should realize that "a/objects" and "A/objects" are the same path. We already use fspathcmp() to check against the main object directory, but until recently we couldn't use it for comparing against other alternates (because their paths were not NUL-terminated strings). But now we can, so let's do so. Note that we also need to adjust count-objects to load the config, so that it can see the setting of core.ignorecase (this is required by the test, but is also a general bugfix for users of count-objects). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 9cad56f7b0..064651947d 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -260,7 +260,7 @@ static int alt_odb_usable(struct strbuf *path, const char *normalized_objdir)
* thing twice, or object directory itself.
*/
for (alt = alt_odb_list; alt; alt = alt->next) {
- if (!strcmp(path->buf, alt->path))
+ if (!fspathcmp(path->buf, alt->path))
return 0;
}
if (!fspathcmp(path->buf, normalized_objdir))