aboutsummaryrefslogtreecommitdiff
path: root/fetch-pack.c
diff options
context:
space:
mode:
Diffstat (limited to 'fetch-pack.c')
-rw-r--r--fetch-pack.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fetch-pack.c b/fetch-pack.c
index 655ee6425..058c25837 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -544,10 +544,14 @@ static void filter_refs(struct fetch_pack_args *args,
/* Append unmatched requests to the list */
if (allow_tip_sha1_in_want) {
for (i = 0; i < nr_sought; i++) {
+ unsigned char sha1[20];
+
ref = sought[i];
if (ref->matched)
continue;
- if (get_sha1_hex(ref->name, ref->old_sha1))
+ if (get_sha1_hex(ref->name, sha1) ||
+ ref->name[40] != '\0' ||
+ hashcmp(sha1, ref->old_sha1))
continue;
ref->matched = 1;