summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2014-08-03 20:25:33 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2014-08-03 20:25:33 +0100
commit27770bb8b01de8961513430402d3efa68873b5e6 (patch)
tree38d9074731cd248f9908d5c09a111e18560ac420
parent48bc72cd47446153ac9a94f4fe9fb14717d8bbc7 (diff)
Do not remove destination when clone fails because it already exists (!)
-rwxr-xr-xdgit6
1 files changed, 6 insertions, 0 deletions
diff --git a/dgit b/dgit
index 17b7189..d587527 100755
--- a/dgit
+++ b/dgit
@@ -1515,6 +1515,12 @@ sub cmd_clone {
}
$dstdir ||= "$package";
+ if (stat $dstdir) {
+ fail "$dstdir already exists";
+ } elsif ($! != &ENOENT) {
+ die "$dstdir: $!";
+ }
+
my $cwd_remove;
if ($rmonerror && !$dryrun_level) {
$cwd_remove= getcwd();