summaryrefslogtreecommitdiff
path: root/builtin/describe.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-02-27 18:33:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-02-27 18:33:57 (GMT)
commit1ba6846a19b0358ddf4098d44ba5804646c36412 (patch)
treebf9e5dd01b954d84c3b54ff3ec412eb090188d48 /builtin/describe.c
parent796a788a1c1a2f6a93763312a840d7ed67a8e32f (diff)
parenta8e7a2bf0fe843836f4ec286c6cdba24bf40fac8 (diff)
downloadgit-1ba6846a19b0358ddf4098d44ba5804646c36412.zip
git-1ba6846a19b0358ddf4098d44ba5804646c36412.tar.gz
git-1ba6846a19b0358ddf4098d44ba5804646c36412.tar.bz2
Merge branch 'sb/describe-blob'
"git describe $garbage" stopped giving any errors when the garbage happens to be a string with 40 hexadecimal letters. * sb/describe-blob: describe: confirm that blobs actually exist
Diffstat (limited to 'builtin/describe.c')
-rw-r--r--builtin/describe.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/describe.c b/builtin/describe.c
index c428984..e4869df 100644
--- a/builtin/describe.c
+++ b/builtin/describe.c
@@ -502,7 +502,7 @@ static void describe(const char *arg, int last_one)
if (cmit)
describe_commit(&oid, &sb);
- else if (lookup_blob(&oid))
+ else if (sha1_object_info(oid.hash, NULL) == OBJ_BLOB)
describe_blob(oid, &sb);
else
die(_("%s is neither a commit nor blob"), arg);