summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-07-02 19:04:52 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-07-09 23:42:22 (GMT)
commitcd74e4733db3e2353077bdc7021caa70bed2a483 (patch)
tree0f8f243291844cb4208996065ff8ca84b99a4de1 /cache.h
parent33bd598c3902c40c5a10a68aeaa3004484239258 (diff)
downloadgit-cd74e4733db3e2353077bdc7021caa70bed2a483.zip
git-cd74e4733db3e2353077bdc7021caa70bed2a483.tar.gz
git-cd74e4733db3e2353077bdc7021caa70bed2a483.tar.bz2
sha1_name.c: introduce get_sha1_committish()
Many callers know that the user meant to name a committish by syntactical positions where the object name appears. Calling this function allows the machinery to disambiguate shorter-than-unique abbreviated object names between committish and others. Note that this does NOT error out when the named object is not a committish. It is merely to give a hint to the disambiguation machinery. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index e1fa63b..e947b48 100644
--- a/cache.h
+++ b/cache.h
@@ -817,6 +817,7 @@ struct object_context {
#define GET_SHA1_ONLY_TO_DIE 04000
extern int get_sha1(const char *str, unsigned char *sha1);
+extern int get_sha1_committish(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);