Merge branch 'rs/strbuf-add-real-path'
authorJunio C Hamano <gitster@pobox.com>
Fri, 10 Mar 2017 21:24:23 +0000 (13:24 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 10 Mar 2017 21:24:23 +0000 (13:24 -0800)
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

1  2 
setup.c
strbuf.h
worktree.c
diff --cc setup.c
index 967f289f1ef07d78f4b680e1d880e2fa86215371,5af64ad530a30d21fb939cbf3c5dd941489a24f0..f14cbcd3383528566e37cdf76b1fcf517cd31f1e
+++ 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;
diff --cc strbuf.h
Simple merge
diff --cc worktree.c
Simple merge