From: Junio C Hamano Date: Tue, 25 Nov 2008 18:17:56 GMT Subject: Re: [PATCH] rev-parse: Fix shell scripts whose cwd is a symlink into a git work-dir Message-ID: <7vtz9vk6uj.fsf@gitster.siamese.dyndns.org> In-Reply-To: <492C24D4.1010306@oak.homeunix.org> "Marcel M. Cary" writes: > Nor have I seen a response to the idea of correcting the shell's > behavior in cd_to_toplevel, for example by adding a "cd `pwd`",... I think you probably could fool the shell by unsetting PWD or something silly like that (or "cd -P" which may not be supported by non POSIX shells but I suspect the ones we care about do support it). Doing a 'cd "$(pwd)"' inside cd_to_toplevel would be a less objectionable and arguably more portable workaround for the case where you have a symlink pointing into somewhere in your work tree.