]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'rs/strbuf-expand-step'
authorJunio C Hamano <gitster@pobox.com>
Thu, 6 Jul 2023 18:54:45 +0000 (11:54 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 6 Jul 2023 18:54:45 +0000 (11:54 -0700)
Code clean-up around strbuf_expand() API.

* rs/strbuf-expand-step:
  strbuf: simplify strbuf_expand_literal_cb()
  replace strbuf_expand() with strbuf_expand_step()
  replace strbuf_expand_dict_cb() with strbuf_expand_step()
  strbuf: factor out strbuf_expand_step()
  pretty: factor out expand_separator()

1  2 
builtin/branch.c
builtin/cat-file.c
builtin/ls-files.c
builtin/ls-tree.c
convert.c
merge-ll.c
pretty.c
strbuf.c
strbuf.h

Simple merge
index ab8ac105e3a0c8646c3735acdf316fac1830393f,424f39675b4ad253ef48ead36006d912ee501f70..fab04310fb6345154efcf424af11e624bb26f3ce
@@@ -493,10 -492,10 +493,10 @@@ static void batch_object_write(const ch
        strbuf_reset(scratch);
  
        if (!opt->format) {
 -              print_default_format(scratch, data);
 +              print_default_format(scratch, data, opt);
        } else {
-               strbuf_expand(scratch, opt->format, expand_format, data);
+               expand_format(scratch, opt->format, data);
 -              strbuf_addch(scratch, '\n');
 +              strbuf_addch(scratch, opt->output_delim);
        }
  
        batch_write(opt, scratch->buf, scratch->len);
Simple merge
Simple merge
diff --cc convert.c
Simple merge
diff --cc merge-ll.c
index 478983309d6d4240615d21cef2e47bcde3c7ecde,b307ad293c728b43bb598de65848b49977559fc4..933adc3769cf7b03979e1bcc31c1ae37da4fe738
@@@ -242,15 -247,7 +247,13 @@@ static enum ll_merge_result ll_ext_merg
        for (i = 0; i < 3; i++)
                unlink_or_warn(temp[i]);
        strbuf_release(&cmd);
-       strbuf_release(&path_sq);
 -      ret = (status > 0) ? LL_MERGE_CONFLICT : status;
 +      if (!status)
 +              ret = LL_MERGE_OK;
 +      else if (status <= 128)
 +              ret = LL_MERGE_CONFLICT;
 +      else
 +              /* died due to a signal: WTERMSIG(status) + 128 */
 +              ret = LL_MERGE_ERROR;
        return ret;
  }
  
diff --cc pretty.c
Simple merge
diff --cc strbuf.c
Simple merge
diff --cc strbuf.h
Simple merge