diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-07-02 19:00:40 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-07-10 01:42:22 +0200 |
commit | e2643617d75e53e5a69278f8d7382553d1c14cf0 (patch) | |
tree | afbcff536ceab46f29c80d65e56d08df721b3e9c /cache.h | |
parent | sha1_name.c: get_sha1_1() takes lookup flags (diff) | |
download | git-e2643617d75e53e5a69278f8d7382553d1c14cf0.tar.xz git-e2643617d75e53e5a69278f8d7382553d1c14cf0.zip |
sha1_name.c: many short names can only be committish
We know that the token "$name" that appear in "$name^{commit}",
"$name^4", "$name~4" etc. can only name a committish (either a
commit or a tag that peels to a commit). Teach get_short_sha1() to
take advantage of that knowledge when disambiguating an abbreviated
SHA-1 given as an object name.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -813,6 +813,7 @@ struct object_context { #define GET_SHA1_QUIETLY 01 #define GET_SHA1_COMMIT 02 +#define GET_SHA1_COMMITTISH 04 extern int get_sha1(const char *str, unsigned char *sha1); extern void maybe_die_on_misspelt_object_name(const char *name, const char *prefix); |