diff options
author | Thomas Wolf <thomas.wolf@paranor.ch> | 2018-05-24 16:26:36 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2018-05-25 06:08:25 -0500 |
commit | de21c58d03d9f54e0a80d358948517d3ea518312 (patch) | |
tree | 97cc673826bb1d46844f9065502bb86bb42fffe4 /org.eclipse.jgit/src/org/eclipse | |
parent | 9ad70313818aad4a64a7d5d30c2c428948fb28de (diff) | |
download | jgit-de21c58d03d9f54e0a80d358948517d3ea518312.tar.gz jgit-de21c58d03d9f54e0a80d358948517d3ea518312.zip |
Don't prune symbolic refs when fetch.prune = true
The canonical implementation also doesn't. Compare current
code in remote.c, function get_stale_heads_cb.[1] Not handling
symrefs in this case was introduced in canonical git in [2]
in 2008.
[1] https://github.com/git/git/blob/v2.17.0/remote.c#L2259
[2] https://github.com/git/git/commit/740fdd27f0
Bug: 533549
Change-Id: If348d56bb4a96b8aa7141f7e7b5a0d3dd4e7808b
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java | 3 |
1 files changed, 3 insertions, 0 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 51f900b246..ff183c8974 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/FetchProcess.java @@ -480,6 +480,9 @@ class FetchProcess { private void deleteStaleTrackingRefs(FetchResult result, BatchRefUpdate batch) throws IOException { for (Ref ref : localRefs().values()) { + if (ref.isSymbolic()) { + continue; + } final String refname = ref.getName(); for (RefSpec spec : toFetch) { if (spec.matchDestination(refname)) { |