X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=contrib%2Fworkdir%2Fgit-new-workdir;h=7959eab902d28bb3307c542514ca4c5f49deee0f;hb=1f1e1257a176ce851ffb683bbba505ae22625ec9;hp=c6e154a84fb5bdd4ed456ac3fdf94c54466fc5f0;hpb=e92ea62425fb89713bc47241af29a79f5f191cc6;p=git.git diff --git a/contrib/workdir/git-new-workdir b/contrib/workdir/git-new-workdir index c6e154a84..7959eab90 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) @@ -57,7 +63,7 @@ mkdir -p "$new_workdir/.git" || die "unable to create \"$new_workdir\"!" # create the links to the original repo. explictly exclude index, HEAD and # logs/HEAD from the list since they are purely related to the current working # directory, and should not be shared. -for x in config refs logs/refs objects info hooks packed-refs remotes rr-cache +for x in config refs logs/refs objects info hooks packed-refs remotes rr-cache svn do case $x in */*)