]> rtime.felk.cvut.cz Git - git.git/blobdiff - builtin/describe.c
Merge branch 'kb/fast-hashmap'
[git.git] / builtin / describe.c
index 104202898e42f8c59cdd15a6433c4bef187d8493..dadd999c41f6aebe488d057e94e239dfb7dffaec 100644 (file)
@@ -9,7 +9,7 @@
 #include "hashmap.h"
 #include "argv-array.h"
 
-#define SEEN           (1u<<0)
+#define SEEN           (1u << 0)
 #define MAX_TAGS       (FLAG_BITS - 1)
 
 static const char * const describe_usage[] = {
@@ -36,7 +36,6 @@ static const char *diff_index_args[] = {
        "diff-index", "--quiet", "HEAD", "--", NULL
 };
 
-
 struct commit_name {
        struct hashmap_entry entry;
        unsigned char peeled[20];
@@ -46,6 +45,7 @@ struct commit_name {
        unsigned char sha1[20];
        char *path;
 };
+
 static const char *prio_names[] = {
        "head", "lightweight", "annotated",
 };
@@ -129,7 +129,7 @@ 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)
 {
-       int is_tag = !prefixcmp(path, "refs/tags/");
+       int is_tag = starts_with(path, "refs/tags/");
        unsigned char peeled[20];
        int is_annotated, prio;
 
@@ -483,9 +483,8 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
        } else if (dirty) {
                die(_("--dirty is incompatible with commit-ishes"));
        } else {
-               while (argc-- > 0) {
+               while (argc-- > 0)
                        describe(*argv++, argc == 0);
-               }
        }
        return 0;
 }