Merge branch 'sg/doc-test-must-fail-args'
[gitweb.git] / builtin / describe.c
index 6fe1c51281bf1bb6a92f00d837fecf60fe38ca31..e4869df7b434845544dfcc0c37cae6a77cd42dad 100644 (file)
@@ -383,7 +383,7 @@ static void describe_commit(struct object_id *oid, struct strbuf *dst)
        if (!match_cnt) {
                struct object_id *cmit_oid = &cmit->object.oid;
                if (always) {
-                       strbuf_addstr(dst, find_unique_abbrev(cmit_oid->hash, abbrev));
+                       strbuf_add_unique_abbrev(dst, cmit_oid->hash, abbrev);
                        if (suffix)
                                strbuf_addstr(dst, suffix);
                        return;
@@ -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);