Skip to content

Commit

Permalink
make 'git describe --all --contains' work
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Nicolas Pitre authored and Junio C Hamano committed Dec 19, 2007
1 parent c569969 commit 3f7701a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions builtin-describe.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,14 @@ int cmd_describe(int argc, const char **argv, const char *prefix)

if (contains) {
const char **args = xmalloc((4 + argc) * sizeof(char*));
args[0] = "name-rev";
args[1] = "--name-only";
args[2] = "--tags";
memcpy(args + 3, argv, argc * sizeof(char*));
args[3 + argc] = NULL;
return cmd_name_rev(3 + argc, args, prefix);
int i = 0;
args[i++] = "name-rev";
args[i++] = "--name-only";
if (!all)
args[i++] = "--tags";
memcpy(args + i, argv, argc * sizeof(char*));
args[i + argc] = NULL;
return cmd_name_rev(i + argc, args, prefix);
}

if (argc == 0) {
Expand Down

0 comments on commit 3f7701a

Please sign in to comment.