diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2014-08-03 20:25:33 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2014-08-03 20:25:33 +0100 |
commit | 27770bb8b01de8961513430402d3efa68873b5e6 (patch) | |
tree | 38d9074731cd248f9908d5c09a111e18560ac420 /dgit | |
parent | 48bc72cd47446153ac9a94f4fe9fb14717d8bbc7 (diff) |
Do not remove destination when clone fails because it already exists (!)
Diffstat (limited to 'dgit')
-rwxr-xr-x | dgit | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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(); |