Skip to contentSkip to conversation

Allow git config files to use keys containing the hyphen character '-'

PATCH New [email protected] 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Allow git config files to use keys containing the hyphen character '-'

From: Thad Hughes <[email protected]>

---
 .../src/org/spearce/jgit/lib/RepositoryConfig.java |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java +4 -1
index 78ceba7..42b2c5d 100644
@@ -496,7 +496,10 @@ public class RepositoryConfig {
 					}
 				}
 				break;
-			} else if (Character.isLetterOrDigit((char) c)) {
+			} else if (Character.isLetterOrDigit((char) c) || c == '-') {
+				// From the git-config man page: 
+				//     The variable names are case-insensitive and only 
+				//     alphanumeric characters and - are allowed.
 				name.append((char) c);
 			} else if ('\n' == c) {
 				r.reset();
Signature · 1 line
1.5.4.2.156.ge3c5