Merge branch 'jk/blame-commit-label' into maint
"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
This commit is contained in:
@ -678,6 +678,11 @@ extern char *xgetcwd(void);
|
||||
|
||||
#define REALLOC_ARRAY(x, alloc) (x) = xrealloc((x), (alloc) * sizeof(*(x)))
|
||||
|
||||
static inline char *xstrdup_or_null(const char *str)
|
||||
{
|
||||
return str ? xstrdup(str) : NULL;
|
||||
}
|
||||
|
||||
static inline size_t xsize_t(off_t len)
|
||||
{
|
||||
if (len > (size_t) len)
|
||||
|
Reference in New Issue
Block a user