On Sat, Dec 10, 2016 at 2:42 AM, Brandon Williams <bmwill@xxxxxxxxxx> wrote: > On 12/09, Duy Nguyen wrote: >> On Fri, Dec 9, 2016 at 6:58 AM, Brandon Williams <bmwill@xxxxxxxxxx> wrote: >> > diff --git a/setup.c b/setup.c >> > index fe572b8..0d9fdd0 100644 >> > --- a/setup.c >> > +++ b/setup.c >> > @@ -254,10 +254,12 @@ int get_common_dir_noenv(struct strbuf *sb, const char *gitdir) >> > if (!is_absolute_path(data.buf)) >> > strbuf_addf(&path, "%s/", gitdir); >> > strbuf_addbuf(&path, &data); >> > - strbuf_addstr(sb, real_path(path.buf)); >> > + strbuf_realpath(sb, path.buf, 1); >> >> This is not the same because of this hunk in strbuf_realpath() > > Then perhaps I shouldn't make this change (and just leave it as is) > since the way real_path_internal/strbuf_realpath is written requires > that the strbuf being used for the resolved path only contains the > resolved path (see the lstat(resolved->buf &st) call). Sidenote it > looks like strbuf_getcwd() also does a reset, though more subtlety, > since it just passes its buffer to getcwd(). Yeah that's ok too (I did not see this subtlety when I suggested the change). -- Duy