summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c569969)
raw | patch | inline | side by side (parent: c569969)
author | Nicolas Pitre <nico@cam.org> | |
Wed, 19 Dec 2007 17:53:16 +0000 (12:53 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 19 Dec 2007 22:59:19 +0000 (14:59 -0800) |
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-describe.c | patch | blob | history |
diff --git a/builtin-describe.c b/builtin-describe.c
index 6eeb9b50456da53e396136c11904bbdc3d36a921..7a148a2c26591d82e6057d610182445eae5fe171 100644 (file)
--- a/builtin-describe.c
+++ b/builtin-describe.c
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) {