summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-07-02 17:32:11 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-07-09 23:42:22 (GMT)
commit33bd598c3902c40c5a10a68aeaa3004484239258 (patch)
tree22343053edd965f69d872b3f221e022a593fef4b /cache.h
parente2643617d75e53e5a69278f8d7382553d1c14cf0 (diff)
downloadgit-33bd598c3902c40c5a10a68aeaa3004484239258.zip
git-33bd598c3902c40c5a10a68aeaa3004484239258.tar.gz
git-33bd598c3902c40c5a10a68aeaa3004484239258.tar.bz2
sha1_name.c: teach lookup context to get_sha1_with_context()
The function takes user input string and returns the object name (binary SHA-1) with mode bits and path when the object was looked up in a tree. Additionally give hints to help disambiguation of abbreviated object names when the caller knows what it is looking for. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/cache.h b/cache.h
index 1508fdb..e1fa63b 100644
--- a/cache.h
+++ b/cache.h
@@ -814,10 +814,11 @@ struct object_context {
#define GET_SHA1_QUIETLY 01
#define GET_SHA1_COMMIT 02
#define GET_SHA1_COMMITTISH 04
+#define GET_SHA1_ONLY_TO_DIE 04000
extern int get_sha1(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 char *sha1, struct object_context *orc);
+extern int get_sha1_with_context(const char *str, unsigned flags, unsigned char *sha1, struct object_context *orc);
/*
* Try to read a SHA1 in hexadecimal format from the 40 characters