summaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-07-02 10:32:11 -0700
committerJunio C Hamano <gitster@pobox.com>2012-07-09 16:42:22 -0700
commit33bd598c3902c40c5a10a68aeaa3004484239258 (patch)
tree22343053edd965f69d872b3f221e022a593fef4b /revision.c
parente2643617d75e53e5a69278f8d7382553d1c14cf0 (diff)
downloadgit-33bd598c3902c40c5a10a68aeaa3004484239258.tar.gz
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 'revision.c')
-rw-r--r--revision.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/revision.c b/revision.c
index 86a14c8af6..7444f2eaa1 100644
--- a/revision.c
+++ b/revision.c
@@ -1180,7 +1180,7 @@ int handle_revision_arg(const char *arg_, struct rev_info *revs,
local_flags = UNINTERESTING;
arg++;
}
- if (get_sha1_with_context(arg, sha1, &oc))
+ if (get_sha1_with_context(arg, 0, sha1, &oc))
return revs->ignore_missing ? 0 : -1;
if (!cant_be_filename)
verify_non_filename(revs->prefix, arg);
@@ -1795,7 +1795,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
unsigned char sha1[20];
struct object *object;
struct object_context oc;
- if (get_sha1_with_context(revs->def, sha1, &oc))
+ if (get_sha1_with_context(revs->def, 0, sha1, &oc))
die("bad default revision '%s'", revs->def);
object = get_reference(revs, revs->def, sha1, 0);
add_pending_object_with_mode(revs, object, revs->def, oc.mode);