]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jc/rerere-modern-strbuf-handling'
authorJunio C Hamano <gitster@pobox.com>
Fri, 27 Mar 2026 18:00:03 +0000 (11:00 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 27 Mar 2026 18:00:03 +0000 (11:00 -0700)
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 strbufs

1  2 
rerere.c
tools/coccinelle/strbuf.cocci

diff --cc rerere.c
Simple merge
index 83bd93be5fce8dc43e5314c111baa4b2df7fb29f,13f0ad267902f5ba46aefabe50f455cee6289c25..f5861283297acda05e1045d0d5e6e25731a8f089
@@@ -61,13 -61,9 +61,20 @@@ expression E1, E2
  - strbuf_addstr(E1, real_path(E2));
  + strbuf_add_real_path(E1, E2);
  
 +@@
 +identifier fn, param;
 +@@
 +  fn(...,
 +- struct strbuf param
 ++ struct strbuf *param
 +  ,...)
 +  {
 +  ...
 +  }
++
+ // In modern codebase, .buf member of an empty strbuf is not NULL.
+ @@
+ struct strbuf SB;
+ @@
+ - SB.buf ? SB.buf : ""
+ + SB.buf