diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-11-23 22:23:16 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-11-23 22:23:16 +0300 |
commit | 48e9ad5ef3afd39168e2fb72d0ce7ac5f7124d31 (patch) | |
tree | cc1d0d3e96248ff01d1449eb5999a7ebed632724 /ref-filter.c | |
parent | 1e37181391e305a7ab0c382ca3c3b2de998d4138 (diff) | |
parent | 84679d470d577bcde1b6aa6af36c08a2d77b6e68 (diff) |
Merge branch 'jc/for-each-ref-head-segfault-fix'
Using a %(HEAD) placeholder in "for-each-ref --format=" option
caused the command to segfault when on an unborn branch.
* jc/for-each-ref-head-segfault-fix:
for-each-ref: do not segv with %(HEAD) on an unborn branch
Diffstat (limited to 'ref-filter.c')
-rw-r--r-- | ref-filter.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ref-filter.c b/ref-filter.c index d4c2931f3a..f5f7a70c6d 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -1017,7 +1017,7 @@ static void populate_value(struct ref_array_item *ref) head = resolve_ref_unsafe("HEAD", RESOLVE_REF_READING, sha1, NULL); - if (!strcmp(ref->refname, head)) + if (head && !strcmp(ref->refname, head)) v->s = "*"; else v->s = " "; |