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
This commit is contained in:
Junio C Hamano
2018-02-27 10:33:57 -08:00
2 changed files with 9 additions and 1 deletions

View File

@ -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);