summaryrefslogtreecommitdiff
path: root/contrib/workdir
diff options
context:
space:
mode:
authorJulian Phillips <julian@quantumfyre.co.uk>2007-06-19 11:44:43 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-06-24 09:36:56 (GMT)
commit09381b458f5f1ac1a78df1aaeeb53aa79fcf2c4f (patch)
treec2155fe543e7578de3d16caf1790784ae7caafcf /contrib/workdir
parentf58494bf82c260bf8794b2744158d84fc242cbf0 (diff)
downloadgit-09381b458f5f1ac1a78df1aaeeb53aa79fcf2c4f.zip
git-09381b458f5f1ac1a78df1aaeeb53aa79fcf2c4f.tar.gz
git-09381b458f5f1ac1a78df1aaeeb53aa79fcf2c4f.tar.bz2
new-workdir: handle rev-parse --git-dir not always giving full path
rev-parse --git-dir outputs a full path - except for the single case of when the path would be $(pwd)/.git, in which case it outputs simply .git. Check for this special case and handle it. Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/workdir')
-rwxr-xr-xcontrib/workdir/git-new-workdir5
1 files changed, 5 insertions, 0 deletions
diff --git a/contrib/workdir/git-new-workdir b/contrib/workdir/git-new-workdir
index f2a3615..709b2a3 100755
--- a/contrib/workdir/git-new-workdir
+++ b/contrib/workdir/git-new-workdir
@@ -24,6 +24,11 @@ git_dir=$(cd "$orig_git" 2>/dev/null &&
git rev-parse --git-dir 2>/dev/null) ||
die "\"$orig_git\" is not a git repository!"
+if test "$git_dir" == ".git"
+then
+ git_dir="$orig_git/.git"
+fi
+
# don't link to a workdir
if test -L "$git_dir/config"
then