From: Junio C Hamano Date: Wed, 11 Feb 2015 21:39:50 +0000 (-0800) Subject: Merge branch 'jk/blame-commit-label' X-Git-Tag: v2.4.0-rc0~139 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=092c4be7f5d691809913eb83a2360f035c67ab06;p=git Merge branch 'jk/blame-commit-label' "git blame HEAD -- missing" failed to correctly say "HEAD" when it tried to say "No such path 'missing' in HEAD". * jk/blame-commit-label: blame.c: fix garbled error message use xstrdup_or_null to replace ternary conditionals builtin/commit.c: use xstrdup_or_null instead of envdup builtin/apply.c: use xstrdup_or_null instead of null_strdup git-compat-util: add xstrdup_or_null helper --- 092c4be7f5d691809913eb83a2360f035c67ab06 diff --cc refs.c index ed3b2cb405,32dce4e41c..9edf18b04e --- a/refs.c +++ b/refs.c @@@ -1616,10 -1526,10 +1616,9 @@@ const char *resolve_ref_unsafe(const ch } } -char *resolve_refdup(const char *ref, unsigned char *sha1, int reading, int *flag) +char *resolve_refdup(const char *ref, int resolve_flags, unsigned char *sha1, int *flags) { - const char *ret = resolve_ref_unsafe(ref, resolve_flags, sha1, flags); - return ret ? xstrdup(ret) : NULL; - return xstrdup_or_null(resolve_ref_unsafe(ref, sha1, reading, flag)); ++ return xstrdup_or_null(resolve_ref_unsafe(ref, resolve_flags, sha1, flags)); } /* The argument to filter_refs */