From 609de52600e6a5477b960cc36245dd105898965b Mon Sep 17 00:00:00 2001 From: Stefan Beller Date: Wed, 24 Aug 2016 12:47:10 -0700 Subject: [PATCH] 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 --- org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 1a4b5525b..98af186b2 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 results = push.call(); for (PushResult result : results) { try (ObjectReader reader = db.newObjectReader()) {