Browse Source

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>
tags/v4.9.0.201710071750-r
Thomas Wolf 6 years ago
parent
commit
426caf99ee
1 changed files with 7 additions and 2 deletions
  1. 7
    2
      org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteConfig.java

+ 7
- 2
org.eclipse.jgit/src/org/eclipse/jgit/transport/RemoteConfig.java View File

@@ -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);
}

Loading…
Cancel
Save