summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-07-03 14:21:59 -0700
committerJunio C Hamano <gitster@pobox.com>2012-07-09 16:42:23 -0700
commit957d74062c1f0e92368aeda335e27d2d61f584f6 (patch)
tree7b5c5c54cfe2d06d741ec8fcd103f1a8eeddcb38 /cache.h
parentc036c4c5e426cc7ee8070038607edf06ef1d661e (diff)
downloadgit-957d74062c1f0e92368aeda335e27d2d61f584f6.tar.gz
rev-parse --disambiguate=<prefix>
The new option allows you to feed an ambiguous prefix and enumerate all the objects that share it as a prefix of their object names. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index c8d6406bca..63388780a0 100644
--- a/cache.h
+++ b/cache.h
@@ -828,6 +828,9 @@ extern int get_sha1_blob(const char *str, unsigned char *sha1);
extern void maybe_die_on_misspelt_object_name(const char *name, const char *prefix);
extern int get_sha1_with_context(const char *str, unsigned flags, unsigned char *sha1, struct object_context *orc);
+typedef int each_abbrev_fn(const unsigned char *sha1, void *);
+extern int for_each_abbrev(const char *prefix, each_abbrev_fn, void *);
+
/*
* Try to read a SHA1 in hexadecimal format from the 40 characters
* starting at hex. Write the 20-byte result to sha1 in binary form.