diff-tree: teach single-commit diff-tree to honour grafts
[git.git] / t / t1300-config-set.sh
index 717bf4d..7a5849a 100644 (file)
@@ -69,6 +69,28 @@ EOF
 
 test_expect_success 'similar section' 'cmp .git/config expect'
 
+test_expect_success 'replace with non-match' \
+       'git-config-set core.penguin kingpin !blue'
+
+test_expect_success 'replace with non-match (actually matching)' \
+       'git-config-set core.penguin "very blue" !kingpin'
+
+cat > expect << EOF
+#
+# This is the config file
+#
+
+[core]
+       penguin = very blue
+       Movie = BadPhysics
+       UPPERCASE = true
+       penguin = kingpin
+[Cores]
+       WhatEver = Second
+EOF
+
+test_expect_success 'non-match result' 'cmp .git/config expect'
+
 cat > .git/config << EOF
 [beta] ; silly comment # another comment
 noIndent= sillyValue ; 'nother silly comment
@@ -173,6 +195,12 @@ EOF
 
 test_expect_success 'multivar' 'cmp .git/config expect'
 
+test_expect_success 'non-match' \
+       'git-config-set --get nextsection.nonewline !for'
+
+test_expect_success 'non-match value' \
+       'test wow = $(git-config-set --get nextsection.nonewline !for)'
+
 test_expect_failure 'ambiguous get' \
        'git-config-set --get nextsection.nonewline'
 
@@ -220,5 +248,24 @@ test_expect_failure 'invalid key' 'git-config-set inval.2key blabla'
 
 test_expect_success 'correct key' 'git-config-set 123456.a123 987'
 
+test_expect_success 'hierarchical section' \
+       'git-config-set 1.2.3.alpha beta'
+
+cat > expect << EOF
+[beta] ; silly comment # another comment
+noIndent= sillyValue ; 'nother silly comment
+
+# empty line
+               ; comment
+[nextSection]
+       NoNewLine = wow2 for me
+[123456]
+       a123 = 987
+[1.2.3]
+       alpha = beta
+EOF
+
+test_expect_success 'hierarchical section value' 'cmp .git/config expect'
+
 test_done