All of lore.kernel.org
 help / color / mirror / Atom feed
From: thadh@google.com
To: git@vger.kernel.org
Cc: thadh@google.com, Thad Hughes <thadh@google.com>
Subject: [PATCH] Allow git config files to use keys containing the hyphen character '-'
Date: Fri, 28 Mar 2008 16:15:33 -0700	[thread overview]
Message-ID: <1206746133-25974-1-git-send-email-thadh@google.com> (raw)

From: Thad Hughes <thadh@thad.corp.google.com>

---
 .../src/org/spearce/jgit/lib/RepositoryConfig.java |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java b/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java
index 78ceba7..42b2c5d 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/RepositoryConfig.java
@@ -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();
-- 
1.5.4.2.156.ge3c5

                 reply	other threads:[~2008-03-28 23:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1206746133-25974-1-git-send-email-thadh@google.com \
    --to=thadh@google.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.