path: root/builtin
diff options
authorJunio C Hamano <>2012-07-02 17:32:11 (GMT)
committerJunio C Hamano <>2012-07-09 23:42:22 (GMT)
commit33bd598c3902c40c5a10a68aeaa3004484239258 (patch)
tree22343053edd965f69d872b3f221e022a593fef4b /builtin
parente2643617d75e53e5a69278f8d7382553d1c14cf0 (diff)
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 <>
Diffstat (limited to 'builtin')
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/cat-file.c b/builtin/cat-file.c
index 07bd984..c27268f 100644
--- a/builtin/cat-file.c
+++ b/builtin/cat-file.c
@@ -90,7 +90,7 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name)
unsigned long size;
struct object_context obj_context;
- if (get_sha1_with_context(obj_name, sha1, &obj_context))
+ if (get_sha1_with_context(obj_name, 0, sha1, &obj_context))
die("Not a valid object name %s", obj_name);
buf = NULL;