Merge branch 'jk/asciidoctor-section-heading-markup-fix' into maint
[gitweb.git] / builtin / describe.c
index a36c829e571e155c6b6b35c05ee2ef39ce37f406..7df554326b08581c49f391d061be14cd1164ea88 100644 (file)
@@ -443,10 +443,10 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
                        if (pattern)
                                argv_array_pushf(&args, "--refs=refs/tags/%s", pattern);
                }
-               while (*argv) {
-                       argv_array_push(&args, *argv);
-                       argv++;
-               }
+               if (argc)
+                       argv_array_pushv(&args, argv);
+               else
+                       argv_array_push(&args, "HEAD");
                return cmd_name_rev(args.argc, args.argv, prefix);
        }