]> source.dussan.org Git - jgit.git/commit
Fix fetch refspecs when not cloning all branches 55/52455/8
authorThomas Wolf <thomas.wolf@paranor.ch>
Thu, 23 Jul 2015 18:14:46 +0000 (14:14 -0400)
committerMatthias Sohn <matthias.sohn@sap.com>
Fri, 14 Sep 2018 22:57:13 +0000 (00:57 +0200)
commit54a502f6c6f416dc570f023ffb48f05efd3af3ff
tree49b9eb121cc8d1ab20e2baef8daec7e46206ce72
parentcb4de02e5e7502705ef52264eb76d03a90c950d1
Fix fetch refspecs when not cloning all branches

When not all branches are cloned, the fetch refspec for the
remote should not be "+refs/heads/*:refs/remotes/origin/*":
that would fetch all branches on the very next fetch, thus
making a clone with only a subset of the branches rather
pointless.

Instead, produce refspecs for the cloned branches only.

Canonical git also does this for its --single-branch case;
it doesn't have an option to clone only a subset of the branches
(only one or all).

Bug: 466858
Change-Id: Ie871880f757663437efac1e8b3313094f9e629b3
Also-by: Julian Enoch <julian.enoch@ericsson.com>
Signed-off-by: Julian Enoch <julian.enoch@ericsson.com>
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CloneCommandTest.java
org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java