On Thu, Jun 02, 2016 at 03:15:39PM -0700, Junio C Hamano wrote:

> When your $PWD does not match $(/bin/pwd), e.g. you have your copy
> of the git source tree in one place, point it with a symbolic link,
> and then "cd" to that symbolic link before running 'make test', one
> of the tests in t1308 expects that the per-user configuration was
> reported to have been read from the true path (i.e. relative to the
> target of such a symbolic link), but the test-config program reports
> a path relative to $PWD (i.e. the symbolic link).
> 
> Instead, expect a path relative to $HOME (aka $TRASH_DIRECTORY), as
> per-user configuration is read from $HOME/.gitconfig and the test
> framework sets these shell variables up in such a way to avoid this
> problem.

Looks good.

  Acked-by: Jeff King <[email protected]>

To prevent this in the future, I switched my default --root= to point to
a symlink. I wonder if we could do something in the test suite, though,
as we did long ago by introducing "trash directory" with a space to
catch corner cases.

I guess it would be something like:

  if test_have_prereq SYMLINKS
  then
        mkdir "$TRASH_DIRECTORY.real" &&
        ln -s "$TRASH_DIRECTORY.real" "$TRASH_DIRECTORY"
  else
        mkdir "$TRASH_DIRECTORY"
  fi

but there may be some other tweaks required (e.g., for cleanup).

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to