Merge branch 'jk/status-read-branch-name-fix'
[gitweb.git] / builtin / name-rev.c
index c824d4ec5f1c076e4833c690dad378125dde6da9..9736d4452f28728b4f970bbf52af502d94edba86 100644 (file)
@@ -33,10 +33,7 @@ static void name_rev(struct commit *commit,
                return;
 
        if (deref) {
-               char *new_name = xmalloc(strlen(tip_name)+3);
-               strcpy(new_name, tip_name);
-               strcat(new_name, "^0");
-               tip_name = new_name;
+               tip_name = xstrfmt("%s^0", tip_name);
 
                if (generation)
                        die("generation: %d, but deref?", generation);
@@ -255,9 +252,9 @@ static void show_name(const struct object *obj,
 }
 
 static char const * const name_rev_usage[] = {
-       N_("git name-rev [options] <commit>..."),
-       N_("git name-rev [options] --all"),
-       N_("git name-rev [options] --stdin"),
+       N_("git name-rev [<options>] <commit>..."),
+       N_("git name-rev [<options>] --all"),
+       N_("git name-rev [<options>] --stdin"),
        NULL
 };