{"thread":{"id":"11359","subject":"[PATCH] make 'git describe --all --contains' work","startedAt":"2007-12-19T17:53:16Z","lastAt":"2007-12-19T17:53:16Z","messageCount":1,"participants":["Nicolas Pitre"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"63785","messageId":"alpine.LFD.0.999999.0712191250300.3373@xanadu.home","threadId":"11359","inReplyTo":null,"subject":"[PATCH] make 'git describe --all --contains' work","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2007-12-19T17:53:16Z","receivedAt":"2007-12-19T17:53:16Z","isPatch":true,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"Signed-off-by: Nicolas Pitre <nico@cam.org>\n---\ndiff --git a/builtin-describe.c b/builtin-describe.c\nindex 6eeb9b5..7a148a2 100644\n--- a/builtin-describe.c\n+++ b/builtin-describe.c\n@@ -267,12 +267,14 @@ int cmd_describe(int argc, const char **argv, const char *prefix)\n \n \tif (contains) {\n \t\tconst char **args = xmalloc((4 + argc) * sizeof(char*));\n-\t\targs[0] = \"name-rev\";\n-\t\targs[1] = \"--name-only\";\n-\t\targs[2] = \"--tags\";\n-\t\tmemcpy(args + 3, argv, argc * sizeof(char*));\n-\t\targs[3 + argc] = NULL;\n-\t\treturn cmd_name_rev(3 + argc, args, prefix);\n+\t\tint i = 0;\n+\t\targs[i++] = \"name-rev\";\n+\t\targs[i++] = \"--name-only\";\n+\t\tif (!all)\n+\t\t\targs[i++] = \"--tags\";\n+\t\tmemcpy(args + i, argv, argc * sizeof(char*));\n+\t\targs[i + argc] = NULL;\n+\t\treturn cmd_name_rev(i + argc, args, prefix);\n \t}\n \n \tif (argc == 0) {\n"}]}