* [PATCH] make 'git describe --all --contains' work
@ 2007-12-19 17:53 Nicolas Pitre
0 siblings, 0 replies; only message in thread
From: Nicolas Pitre @ 2007-12-19 17:53 UTC (permalink / raw
To: Junio C Hamano; +Cc: git
Signed-off-by: Nicolas Pitre <nico@cam.org>
---
diff --git a/builtin-describe.c b/builtin-describe.c
index 6eeb9b5..7a148a2 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) {
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2007-12-19 17:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-19 17:53 [PATCH] make 'git describe --all --contains' work Nicolas Pitre
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).