]> git.ipfire.org Git - thirdparty/git.git/blobdiff - describe.c
remove unnecessary initializations
[thirdparty/git.git] / describe.c
index 8a9cd5d52c555330c512b977179ab030ccd28861..2b9301fc1205795e30dfd7a7493cb03cdebdb437 100644 (file)
@@ -8,12 +8,12 @@
 static const char describe_usage[] =
 "git-describe [--all] [--tags] [--abbrev=<n>] <committish>*";
 
-static int all = 0;    /* Default to annotated tags only */
-static int tags = 0;   /* But allow any tags if --tags is specified */
+static int all;        /* Default to annotated tags only */
+static int tags;       /* But allow any tags if --tags is specified */
 
 static int abbrev = DEFAULT_ABBREV;
 
-static int names = 0, allocs = 0;
+static int names, allocs;
 static struct commit_name {
        const struct commit *commit;
        int prio; /* annotated tag = 2, tag = 1, head = 0 */
@@ -67,7 +67,7 @@ static int get_name(const char *path, const unsigned char *sha1)
         * Otherwise only annotated tags are used.
         */
        if (!strncmp(path, "refs/tags/", 10)) {
-               if (object->type == tag_type)
+               if (object->type == OBJ_TAG)
                        prio = 2;
                else
                        prio = 1;
@@ -97,7 +97,7 @@ static int compare_names(const void *_a, const void *_b)
        return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1;
 }
 
-static void describe(char *arg, int last_one)
+static void describe(const char *arg, int last_one)
 {
        unsigned char sha1[20];
        struct commit *cmit;