Merge branch 'rs/use-strbuf-addbuf'
authorJunio C Hamano <gitster@pobox.com>
Mon, 25 Jul 2016 21:13:47 +0000 (14:13 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 25 Jul 2016 21:13:47 +0000 (14:13 -0700)
Code cleanup.

* rs/use-strbuf-addbuf:
  strbuf: avoid calling strbuf_grow() twice in strbuf_addbuf()
  use strbuf_addbuf() for appending a strbuf to another

1  2 
dir.c
path.c
strbuf.c
strbuf.h
wt-status.c

diff --cc dir.c
Simple merge
diff --cc path.c
Simple merge
diff --cc strbuf.c
Simple merge
diff --cc strbuf.h
Simple merge
diff --cc wt-status.c
@@@ -1063,10 -1060,12 +1063,10 @@@ static void abbrev_sha1_in_line(struct 
                        strbuf_addf(split[1], "%s ", abbrev);
                        strbuf_reset(line);
                        for (i = 0; split[i]; i++)
-                               strbuf_addf(line, "%s", split[i]->buf);
+                               strbuf_addbuf(line, split[i]);
                }
        }
 -      for (i = 0; split[i]; i++)
 -              strbuf_release(split[i]);
 -
 +      strbuf_list_free(split);
  }
  
  static void read_rebase_todolist(const char *fname, struct string_list *lines)