If remote branches are present they can not be added
to the RefMap from the local branches - the two RefMaps
have a different value of 'prefix' and consequently an
IllegalArgumentException is thrown.
- allBefore);
}
+ @Test
+ public void testListAllBranchesShouldNotDie() throws Exception {
+ Git git = setUpRepoWithRemote();
+ git.branchList().setListMode(ListMode.ALL).call();
+ }
+
@Test
public void testCreateFromCommit() throws Exception {
Ref branch = git.branchCreate().setName("FromInitial").setStartPoint(
import java.util.Comparator;
import java.util.List;
import java.util.Map;
+import java.util.HashMap;
import org.eclipse.jgit.api.errors.JGitInternalException;
import org.eclipse.jgit.lib.Constants;
} else if (listMode == ListMode.REMOTE) {
refList = repo.getRefDatabase().getRefs(Constants.R_REMOTES);
} else {
- refList = repo.getRefDatabase().getRefs(Constants.R_HEADS);
+ refList = new HashMap<String,Ref>(repo.getRefDatabase().getRefs(
+ Constants.R_HEADS));
refList.putAll(repo.getRefDatabase().getRefs(
Constants.R_REMOTES));
}