From 27770bb8b01de8961513430402d3efa68873b5e6 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 3 Aug 2014 20:25:33 +0100 Subject: Do not remove destination when clone fails because it already exists (!) --- dgit | 6 ++++++ 1 file changed, 6 insertions(+) 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(); -- cgit v1.2.3