[RFC PATCH 0/2] fixing git pull from symlinked directory
- From
Marcel M. Cary <marcel@oak.homeunix.org>
- Date
- Nov 15, 2008, 15:11 UTC
- Message-ID
- <cover.1226759762.git.marcel@oak.homeunix.org>
In a past message I described a problem when pulling in a directory that I arrived at by "cd"-ing to a symlink.
http://article.gmane.org/gmane.comp.version-control.git/98223
I've created a unit test to illustrate the problem and compare it to "git pull" without the symlink and "git push" with the symlink, which both work. That's the first patch in this series.
I think the root cause here is that a shell's "cd" and C's chdir() behave slightly different with symlinks. See the unit test comments for more details.
I can make the unit test pass if I make bash's "cd" behave like chdir() by adding "-P", as in the second patch of this series, but I think that has portability issues. Any tips for addressing that? Maybe instead call realpath() on the result of "git rev-parse --show-cdup" in C before printing it? That's a substantial change as it would print /full/path/to/work-dir/ instead of just "../".
Marcel M. Cary (2): Add failing test for "git pull" in symlinked directory Support shell scripts that run from symlinks into a git working dir
git-sh-setup.sh | 2 +- t/t5521-pull-symlink.sh | 67 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 1 deletions(-) create mode 100644 t/t5521-pull-symlink.sh