Public bug reported:

`gbp clone` on a directory will remove the directory if the clone fails:

/tmp/tmp.XXXXXXXX$ gbp clone ssh://[email protected]/myrepo.git .
gbp:error: Git command failed: Error running git clone: ssh: Could not resolve 
hostname example.invalid: Name or service not known
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

/tmp/tmp.XXXXXXXX$ cd .
cd: error retrieving current directory: getcwd: cannot access parent 
directories: No such file or directory
/tmp/tmp.XXXXXXXX$


Normal `git` does not have this problem:

/tmp/tmp.XXXXXXXX$ git clone ssh://[email protected]/myrepo.git~ .
Cloning into '.'...
ssh: Could not resolve hostname example.invalid: Name or service not known
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
/tmp/tmp.XXXXXXXX$ cd .
/tmp/tmp.XXXXXXXX$


NOTE: This does NOT cause meaningful data loss because `git` refuses to
clone into a non-empty directory:

/tmp/tmp.XXXXXXXX$ mkdir foo
/tmp/tmp.XXXXXXXX$ touch foo/bar
/tmp/tmp.XXXXXXXX$ gbp clone ssh://[email protected]/myrepo.git foo
gbp:error: Git command failed: Error running git clone: fatal: destination path 
'foo' already exists and is not an empty directory.

/tmp/tmp.XXXXXXXX$ cd foo
/tmp/tmp.XXXXXXXX/foo$ gbp clone ssh://[email protected]/myrepo.git .
gbp:error: Git command failed: Error running git clone: fatal: destination path 
'foo' already exists and is not an empty directory.

/tmp/tmp.XXXXXXXX/foo$ ls
bar
/tmp/tmp.XXXXXXXX/foo$ cd .
/tmp/tmp.XXXXXXXX/foo$

ProblemType: Bug
DistroRelease: Ubuntu 15.10
Package: git-buildpackage 0.6.32
ProcVersionSignature: Ubuntu 4.2.0-30.35-generic 4.2.8-ckt3
Uname: Linux 4.2.0-30-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.19.1-0ubuntu5
Architecture: amd64
CurrentDesktop: GNOME
Date: Tue Mar  1 02:27:13 2016
JournalErrors:
 No journal files were found.
 -- No entries --
PackageArchitecture: all
SourcePackage: git-buildpackage
UpgradeStatus: Upgraded to wily on 2015-10-29 (124 days ago)

** Affects: git-buildpackage (Ubuntu)
     Importance: Medium
         Status: New


** Tags: amd64 apport-bug wily

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1551508

Title:
  `gbp clone` deletes specified clone path if clone fails

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/git-buildpackage/+bug/1551508/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to