Subject: Bug: relative core.worktree is resolved from symlink and not its target

From: Daniel Hahler <[email-masked]>
Date: Tue, 04 Feb 2014 11:20:39 +0100

Hi,

when using a submodule "sm", there is a relative worktree in its config:

   .git/modules/sm/config:
   [core]
    worktree = ../../../smworktree

git-new-worktree (from contrib) symlinks this config the new worktree.

From inside the new worktree, git reads the config, but resolves the
relative worktree setting based on the symlink's location.

A fix would be to resolve any relative worktree setting based on the
symlink target's location (the actual config file), and not from the
symlink.

This is with git version 1.8.5.3.

Please consider fixing this.

(I know about various workarounds, e.g. copying and adjusting "config"
or manually setting $GIT_WORK_TREE; more relevant discussion would be
at http://comments.gmane.org/gmane.comp.version-control.git/196019)

Thanks,
Daniel.

-- 
http://daniel.hahler.de/