From: Junio C Hamano Date: Fri, 10 Mar 2017 21:24:23 +0000 (-0800) Subject: Merge branch 'rs/strbuf-add-real-path' X-Git-Tag: v2.13.0-rc0~143 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fc32293502e86be2cabbe5e8e5863a2b657207b8;p=thirdparty%2Fgit.git Merge branch 'rs/strbuf-add-real-path' An helper function to make it easier to append the result from real_path() to a strbuf has been added. * rs/strbuf-add-real-path: strbuf: add strbuf_add_real_path() cocci: use ALLOC_ARRAY --- fc32293502e86be2cabbe5e8e5863a2b657207b8 diff --cc setup.c index 967f289f1e,5af64ad530..f14cbcd338 --- a/setup.c +++ b/setup.c @@@ -254,12 -254,10 +254,12 @@@ int get_common_dir_noenv(struct strbuf if (!is_absolute_path(data.buf)) strbuf_addf(&path, "%s/", gitdir); strbuf_addbuf(&path, &data); - strbuf_addstr(sb, real_path(path.buf)); + strbuf_add_real_path(sb, path.buf); ret = 1; - } else + } else { strbuf_addstr(sb, gitdir); + } + strbuf_release(&data); strbuf_release(&path); return ret;