summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm/src/org
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2016-08-24 12:47:10 -0700
committerJonathan Nieder <jrn@google.com>2016-08-24 15:24:23 -0700
commit609de52600e6a5477b960cc36245dd105898965b (patch)
tree36683040a9eb3707dd668ba39a948769d97e8bf7 /org.eclipse.jgit.pgm/src/org
parentedd8ad4d04897830f08b6793a9493c70c0e9b87a (diff)
downloadjgit-609de52600e6a5477b960cc36245dd105898965b.tar.gz
jgit-609de52600e6a5477b960cc36245dd105898965b.zip
push: Do not use push options unless requested
Unless the user passed --push-option, the client does not intend to pass push options to the server. Without this change, all pushes to servers without push option support fail. Not enabling the feature (instead of enabling it and sending an empty list of options) in this case is more intuitive and matches the behavior of C git push's --push-option parameter better. Bug: 500149 Change-Id: Ia4f13840cc54d8ba54e99b1432108f1c43022c53 Signed-off-by: Stefan Beller <sbeller@google.com>
Diffstat (limited to 'org.eclipse.jgit.pgm/src/org')
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java
index 1a4b5525b6..98af186b2f 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java
@@ -130,7 +130,9 @@ class Push extends TextBuiltin {
push.setThin(thin);
push.setAtomic(atomic);
push.setTimeout(timeout);
- push.setPushOptions(pushOptions);
+ if (!pushOptions.isEmpty()) {
+ push.setPushOptions(pushOptions);
+ }
Iterable<PushResult> results = push.call();
for (PushResult result : results) {
try (ObjectReader reader = db.newObjectReader()) {