summaryrefslogtreecommitdiff
path: root/builtin-describe.c
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2007-12-19 12:53:16 -0500
committerJunio C Hamano <gitster@pobox.com>2007-12-19 14:59:19 -0800
commit3f7701a4db4c26d37e804dc4cdd6641677ea97e8 (patch)
tree288b4082eaba9174dda79787e7f964a109100b2e /builtin-describe.c
parentc5699693638d0471bf74425238d802d2bc9e8c0f (diff)
downloadgit-3f7701a4db4c26d37e804dc4cdd6641677ea97e8.tar.gz
make 'git describe --all --contains' work
Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-describe.c')
-rw-r--r--builtin-describe.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/builtin-describe.c b/builtin-describe.c
index 6eeb9b5045..7a148a2c26 100644
--- a/builtin-describe.c
+++ b/builtin-describe.c
@@ -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) {