diff options
Diffstat (limited to 'org.eclipse.jgit/src')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteConfig.java | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteConfig.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteConfig.java index f192be1164..a0d81c00f0 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteConfig.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteConfig.java @@ -173,20 +173,22 @@ public class RemoteConfig implements Serializable { for (final String s : vlst) { uris.add(new URIish(replaceUri(s, insteadOf))); } - Map<String, String> pushInsteadOf = getReplacements(rc, - KEY_PUSHINSTEADOF); String[] plst = rc.getStringList(SECTION, name, KEY_PUSHURL); pushURIs = new ArrayList<>(plst.length); for (final String s : plst) { - pushURIs.add(new URIish(replaceUri(s, pushInsteadOf))); + pushURIs.add(new URIish(s)); } - if (pushURIs.isEmpty() && !pushInsteadOf.isEmpty()) { + if (pushURIs.isEmpty()) { // Would default to the uris. If we have pushinsteadof, we must // supply rewritten push uris. - for (String s : vlst) { - String replaced = replaceUri(s, pushInsteadOf); - if (!s.equals(replaced)) { - pushURIs.add(new URIish(replaced)); + Map<String, String> pushInsteadOf = getReplacements(rc, + KEY_PUSHINSTEADOF); + if (!pushInsteadOf.isEmpty()) { + for (String s : vlst) { + String replaced = replaceUri(s, pushInsteadOf); + if (!s.equals(replaced)) { + pushURIs.add(new URIish(replaced)); + } } } } |