diff options
-rwxr-xr-x | contrib/workdir/git-new-workdir | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/contrib/workdir/git-new-workdir b/contrib/workdir/git-new-workdir index 3ff6bd166a..119cff9859 100755 --- a/contrib/workdir/git-new-workdir +++ b/contrib/workdir/git-new-workdir @@ -24,10 +24,14 @@ 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 +case "$git_dir" in +.git) git_dir="$orig_git/.git" -fi + ;; +.) + git_dir=$orig_git + ;; +esac # don't link to a workdir if test -L "$git_dir/config" |