summaryrefslogtreecommitdiff
path: root/sha1-array.h
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2016-10-06 14:53:10 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-10-06 14:53:10 -0700
commit66c22ba6fbe0724ecce3d82611ff0ec5c2b0255f (patch)
tree8829eb1f019a57f5bdd3743d081e0751f38340c9 /sha1-array.h
parentSync with 2.10.1 (diff)
parentget_short_sha1: make default disambiguation configurable (diff)
downloadtgif-66c22ba6fbe0724ecce3d82611ff0ec5c2b0255f.tar.xz
Merge branch 'jk/ambiguous-short-object-names'
When given an abbreviated object name that is not (or more realistically, "no longer") unique, we gave a fatal error "ambiguous argument". This error is now accompanied by hints that lists the objects that begins with the given prefix. During the course of development of this new feature, numerous minor bugs were uncovered and corrected, the most notable one of which is that we gave "short SHA1 xxxx is ambiguous." twice without good reason. * jk/ambiguous-short-object-names: get_short_sha1: make default disambiguation configurable get_short_sha1: list ambiguous objects on error for_each_abbrev: drop duplicate objects sha1_array: let callbacks interrupt iteration get_short_sha1: mark ambiguity error for translation get_short_sha1: NUL-terminate hex prefix get_short_sha1: refactor init of disambiguation code get_short_sha1: parse tags when looking for treeish get_sha1: propagate flags to child functions get_sha1: avoid repeating ourselves via ONLY_TO_DIE get_sha1: detect buggy calls with multiple disambiguators
Diffstat (limited to 'sha1-array.h')
-rw-r--r--sha1-array.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/sha1-array.h b/sha1-array.h
index 72bb33bec6..b3230be0dd 100644
--- a/sha1-array.h
+++ b/sha1-array.h
@@ -14,10 +14,10 @@ void sha1_array_append(struct sha1_array *array, const unsigned char *sha1);
int sha1_array_lookup(struct sha1_array *array, const unsigned char *sha1);
void sha1_array_clear(struct sha1_array *array);
-typedef void (*for_each_sha1_fn)(const unsigned char sha1[20],
- void *data);
-void sha1_array_for_each_unique(struct sha1_array *array,
- for_each_sha1_fn fn,
+typedef int (*for_each_sha1_fn)(const unsigned char sha1[20],
void *data);
+int sha1_array_for_each_unique(struct sha1_array *array,
+ for_each_sha1_fn fn,
+ void *data);
#endif /* SHA1_ARRAY_H */