rev_list_insert_ref_oid(): new function, taking an object_oid
[gitweb.git] / builtin / describe.c
index 9103193b4f65dc9e224051fb1e19eda6d9c7ae6a..a36c829e571e155c6b6b35c05ee2ef39ce37f406 100644 (file)
@@ -14,8 +14,8 @@
 #define MAX_TAGS       (FLAG_BITS - 1)
 
 static const char * const describe_usage[] = {
-       N_("git describe [options] <commit-ish>*"),
-       N_("git describe [options] --dirty"),
+       N_("git describe [<options>] [<commit-ish>...]"),
+       N_("git describe [<options>] --dirty"),
        NULL
 };
 
@@ -119,10 +119,10 @@ static void add_to_known_names(const char *path,
        }
 }
 
-static int get_name(const char *path, const unsigned char *sha1, int flag, void *cb_data)
+static int get_name(const char *path, const struct object_id *oid, int flag, void *cb_data)
 {
        int is_tag = starts_with(path, "refs/tags/");
-       unsigned char peeled[20];
+       struct object_id peeled;
        int is_annotated, prio;
 
        /* Reject anything outside refs/tags/ unless --all */
@@ -134,10 +134,10 @@ static int get_name(const char *path, const unsigned char *sha1, int flag, void
                return 0;
 
        /* Is it annotated? */
-       if (!peel_ref(path, peeled)) {
-               is_annotated = !!hashcmp(sha1, peeled);
+       if (!peel_ref(path, peeled.hash)) {
+               is_annotated = !!oidcmp(oid, &peeled);
        } else {
-               hashcpy(peeled, sha1);
+               oidcpy(&peeled, oid);
                is_annotated = 0;
        }
 
@@ -154,7 +154,7 @@ static int get_name(const char *path, const unsigned char *sha1, int flag, void
        else
                prio = 0;
 
-       add_to_known_names(all ? path + 5 : path + 10, peeled, prio, sha1);
+       add_to_known_names(all ? path + 5 : path + 10, peeled.hash, prio, oid->hash);
        return 0;
 }