summaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-07-02 12:04:52 -0700
committerJunio C Hamano <gitster@pobox.com>2012-07-09 16:42:22 -0700
commitcd74e4733db3e2353077bdc7021caa70bed2a483 (patch)
tree0f8f243291844cb4208996065ff8ca84b99a4de1 /revision.c
parent33bd598c3902c40c5a10a68aeaa3004484239258 (diff)
downloadgit-cd74e4733db3e2353077bdc7021caa70bed2a483.tar.gz
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 'revision.c')
-rw-r--r--revision.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/revision.c b/revision.c
index 7444f2eaa1..c3160f2e6f 100644
--- a/revision.c
+++ b/revision.c
@@ -979,7 +979,7 @@ static int add_parents_only(struct rev_info *revs, const char *arg_, int flags)
flags ^= UNINTERESTING;
arg++;
}
- if (get_sha1(arg, sha1))
+ if (get_sha1_committish(arg, sha1))
return 0;
while (1) {
it = get_reference(revs, arg, sha1, 0);
@@ -1120,8 +1120,8 @@ int handle_revision_arg(const char *arg_, struct rev_info *revs,
next = "HEAD";
if (dotdot == arg)
this = "HEAD";
- if (!get_sha1(this, from_sha1) &&
- !get_sha1(next, sha1)) {
+ if (!get_sha1_committish(this, from_sha1) &&
+ !get_sha1_committish(next, sha1)) {
struct commit *a, *b;
struct commit_list *exclude;