summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf <thomas.wolf@paranor.ch>2017-08-22 13:23:10 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2017-08-26 09:11:03 +0200
commit426caf99eedfdad0ea5a5702946c40f6ba98ee29 (patch)
tree4e5d6115a0fd1a73d7bfe80c1637a9ba98ac46a0
parent8cbdf523cd60813f69dddece5393c321e5dbe037 (diff)
downloadjgit-426caf99eedfdad0ea5a5702946c40f6ba98ee29.tar.gz
jgit-426caf99eedfdad0ea5a5702946c40f6ba98ee29.zip
Ignore invalid TagOpt values
C git silently ignores invalid tagopt values; so make JGit behave the same way. Bug: 429625 Change-Id: I99587cc46c7e0c19348bcc63f602038fa9a7f378 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteConfig.java9
1 files changed, 7 insertions, 2 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 5449cf15b3..c968ba37cf 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteConfig.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteConfig.java
@@ -206,8 +206,13 @@ public class RemoteConfig implements Serializable {
}
receivepack = val;
- val = rc.getString(SECTION, name, KEY_TAGOPT);
- tagopt = TagOpt.fromOption(val);
+ try {
+ val = rc.getString(SECTION, name, KEY_TAGOPT);
+ tagopt = TagOpt.fromOption(val);
+ } catch (IllegalArgumentException e) {
+ // C git silently ignores invalid tagopt values.
+ tagopt = TagOpt.AUTO_FOLLOW;
+ }
mirror = rc.getBoolean(SECTION, name, KEY_MIRROR, DEFAULT_MIRROR);
timeout = rc.getInt(SECTION, name, KEY_TIMEOUT, 0);
}