Re: bug: git-stash save and symbolic links
- From
Jeff King <peff@peff.net>
- Date
- Oct 20, 2008, 17:55 UTC
- Message-ID
- <20081020175517.GA18539@coredump.intra.peff.net>
- In-Reply-To
- <df1390cc0810200839q5eddad1cp4bc14762724d8848@mail.gmail.com>
On Mon, Oct 20, 2008 at 05:39:31PM +0200, Simon Strandgaard wrote:
Show 6 quoted lines
> mkdir test && > echo content >test/file2 && > git add test/file2 && > git commit -m two && > cd .. && > ln -s repo/test linked &&
Ah, OK. You have a symlink into a subdirectory of the repository. Git correctly finds the repository's .git directory, but then when we attempt to 'cd' to the top-level of the working tree, we end up outside of the repository. The culprit is actually "git rev-parse --show-cdup". This demonstrates it more simply:
mkdir repo && (cd repo && git init) && mkdir repo/dir && ln -s repo/dir linked && cd linked && git rev-parse --show-cdup
which prints "../". But that's not right; we actually need to go to "../repo".
I think the right solution in this situation is that we should _not_ be setting is_inside_work_tree in setup_git_directory_gently, so that we chdir to its absolute path. But I don't think we ever actually detect the symlink during this setup, so I'm not sure how best to realize we are _in_ this situation.
-Peff