From: Junio C Hamano Date: Tue, 28 Mar 2017 20:52:19 +0000 (-0700) Subject: Merge branch 'rs/strbuf-add-real-path' into maint X-Git-Tag: v2.13.0-rc0~51^2~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cd27bc7a0bdb7e62090c503b9e8ab4b4a6bb3d06;p=thirdparty%2Fgit.git Merge branch 'rs/strbuf-add-real-path' into maint 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 --- cd27bc7a0bdb7e62090c503b9e8ab4b4a6bb3d06 diff --cc setup.c index 6b48cb91ff,5af64ad530..8f64fbdfb2 --- 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;