aboutsummaryrefslogtreecommitdiff
path: root/contrib/workdir
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/workdir')
-rwxr-xr-xcontrib/workdir/git-new-workdir6
1 files changed, 6 insertions, 0 deletions
diff --git a/contrib/workdir/git-new-workdir b/contrib/workdir/git-new-workdir
index c6e154a84..2838546d1 100755
--- a/contrib/workdir/git-new-workdir
+++ b/contrib/workdir/git-new-workdir
@@ -48,6 +48,12 @@ then
"a complete repository."
fi
+# don't recreate a workdir over an existing repository
+if test -e "$new_workdir"
+then
+ die "destination directory '$new_workdir' already exists."
+fi
+
# make sure the the links use full paths
git_dir=$(cd "$git_dir"; pwd)