Merge branch 'jc/rerere-modern-strbuf-handling'
Code clean-up overdue by 19 years. * jc/rerere-modern-strbuf-handling: cocci: strbuf.buf is never NULL rerere: update to modern representation of empty strbufsmaint
commit
7241be4123
8
rerere.c
8
rerere.c
|
|
@ -403,12 +403,8 @@ static int handle_conflict(struct strbuf *out, struct rerere_io *io,
|
||||||
strbuf_addbuf(out, &two);
|
strbuf_addbuf(out, &two);
|
||||||
rerere_strbuf_putconflict(out, '>', marker_size);
|
rerere_strbuf_putconflict(out, '>', marker_size);
|
||||||
if (ctx) {
|
if (ctx) {
|
||||||
git_hash_update(ctx, one.buf ?
|
git_hash_update(ctx, one.buf, one.len + 1);
|
||||||
one.buf : "",
|
git_hash_update(ctx, two.buf, two.len + 1);
|
||||||
one.len + 1);
|
|
||||||
git_hash_update(ctx, two.buf ?
|
|
||||||
two.buf : "",
|
|
||||||
two.len + 1);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
} else if (hunk == RR_SIDE_1)
|
} else if (hunk == RR_SIDE_1)
|
||||||
|
|
|
||||||
|
|
@ -71,3 +71,10 @@ identifier fn, param;
|
||||||
{
|
{
|
||||||
...
|
...
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// In modern codebase, .buf member of an empty strbuf is not NULL.
|
||||||
|
@@
|
||||||
|
struct strbuf SB;
|
||||||
|
@@
|
||||||
|
- SB.buf ? SB.buf : ""
|
||||||
|
+ SB.buf
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue