diff options
author | Pierre Habouzit <madcoder@debian.org> | 2007-12-24 12:18:22 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-12-26 15:59:31 -0800 |
commit | a2cf9f445e9074df1a45f5179cef0d4bb8647dd8 (patch) | |
tree | 77e5e5b8af0a862303c046a3becabbba62a3e6b3 /builtin-describe.c | |
parent | 30ffa60377acb443033045a42ffecefdb0921ebb (diff) | |
download | git-a2cf9f445e9074df1a45f5179cef0d4bb8647dd8.tar.gz git-a2cf9f445e9074df1a45f5179cef0d4bb8647dd8.tar.xz |
git-name-rev: add a --(no-)undefined option.
Rework get_rev_name to return NULL rather than "undefined" when a
reference is undefined. If --undefined is passed (default), git-name-rev
prints "undefined" for the name, else it die()s.
Make git-describe use --no-undefined when calling git-name-rev so
that --contains behavior matches the standard git-describe one.
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-describe.c')
-rw-r--r-- | builtin-describe.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin-describe.c b/builtin-describe.c index 18eab47f6..342848313 100644 --- a/builtin-describe.c +++ b/builtin-describe.c @@ -271,10 +271,11 @@ int cmd_describe(int argc, const char **argv, const char *prefix) save_commit_buffer = 0; if (contains) { - const char **args = xmalloc((5 + argc) * sizeof(char*)); + const char **args = xmalloc((6 + argc) * sizeof(char*)); int i = 0; args[i++] = "name-rev"; args[i++] = "--name-only"; + args[i++] = "--no-undefined"; if (!all) { args[i++] = "--tags"; if (pattern) { |