diff options
author | Marc Strapetz <marc.strapetz@syntevo.com> | 2017-12-30 11:33:41 +0100 |
---|---|---|
committer | Thomas Wolf <thomas.wolf@paranor.ch> | 2018-08-22 11:09:00 +0200 |
commit | 65a0cfc82a75146113b9e138cb9fdd5f04c018d0 (patch) | |
tree | 79ff5776ccfe2caf28d01d4f30bd278b3f3bc17b /org.eclipse.jgit | |
parent | 109c07ac8eff08d3fd1210eeb84f5caabd7b09c0 (diff) | |
download | jgit-65a0cfc82a75146113b9e138cb9fdd5f04c018d0.tar.gz jgit-65a0cfc82a75146113b9e138cb9fdd5f04c018d0.zip |
Fetch(Process): should tolerate duplicate refspecs
Bug: 529314
Change-Id: I91eaeda8a988d4786908fba6de00478cfc47a2a2
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java index dd26fe59ad..39f0eea274 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java @@ -481,12 +481,14 @@ class FetchProcess { private void deleteStaleTrackingRefs(FetchResult result, BatchRefUpdate batch) throws IOException { + final Set<Ref> processed = new HashSet<>(); for (final Ref ref : localRefs().values()) { final String refname = ref.getName(); for (final RefSpec spec : toFetch) { if (spec.matchDestination(refname)) { final RefSpec s = spec.expandFromDestination(refname); - if (result.getAdvertisedRef(s.getSource()) == null) { + if (result.getAdvertisedRef(s.getSource()) == null + && processed.add(ref)) { deleteTrackingRef(result, batch, s, ref); } } |