From: Ian Jackson Date: Sun, 3 Aug 2014 19:25:33 +0000 (+0100) Subject: Do not remove destination when clone fails because it already exists (!) X-Git-Tag: debian/0.22~23 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=27770bb8b01de8961513430402d3efa68873b5e6;ds=sidebyside Do not remove destination when clone fails because it already exists (!) --- diff --git a/dgit b/dgit index 17b71898..d587527c 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();