summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d23842f)
raw | patch | inline | side by side (parent: d23842f)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Sat, 20 Jan 2007 01:25:37 +0000 (02:25 +0100) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 20 Jan 2007 01:55:14 +0000 (17:55 -0800) |
This will no longer work:
$ git repo-config 'key.with
newline' some-value
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
$ git repo-config 'key.with
newline' some-value
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
config.c | patch | blob | history | |
t/t1300-repo-config.sh | patch | blob | history |
diff --git a/config.c b/config.c
index b6082f597c118d75a9342d1e0bf5788c7a8257ee..c08c66890f0162fe69452927c48d6835178ed12d 100644 (file)
--- a/config.c
+++ b/config.c
goto out_free;
}
c = tolower(c);
+ } else if (c == '\n') {
+ fprintf(stderr, "invalid key (newline): %s\n", key);
+ free(store.key);
+ ret = 1;
+ goto out_free;
}
store.key[i] = c;
}
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index 60acdd368bfcb6ccb4698f6fd7533dd25befd9b0..eb7455ba21030252d5e988e2d184d16d63a7ea67 100755 (executable)
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
test_expect_success 'quoting' 'cmp .git/config expect'
+test_expect_failure 'key with newline' 'git repo-config key.with\\\
+newline 123'
+
+test_expect_success 'value with newline' 'git repo-config key.sub value.with\\\
+newline'
+
test_done