i18n: blame: mark error messages for translation
[gitweb.git] / t / t1308-config-set.sh
index cd6206351f94ab37b756fbb10a9b5d5fd3373a16..7655c94c2801f0070a7b60ea17f30414b16c8d12 100755 (executable)
@@ -229,4 +229,39 @@ test_expect_success 'error on modifying repo config without repo' '
        )
 '
 
+cmdline_config="'foo.bar=from-cmdline'"
+test_expect_success 'iteration shows correct origins' '
+       echo "[foo]bar = from-repo" >.git/config &&
+       echo "[foo]bar = from-home" >.gitconfig &&
+       if test_have_prereq MINGW
+       then
+               # Use Windows path (i.e. *not* $HOME)
+               HOME_GITCONFIG=$(pwd)/.gitconfig
+       else
+               # Do not get fooled by symbolic links, i.e. $HOME != $(pwd)
+               HOME_GITCONFIG=$HOME/.gitconfig
+       fi &&
+       cat >expect <<-EOF &&
+       key=foo.bar
+       value=from-home
+       origin=file
+       name=$HOME_GITCONFIG
+       scope=global
+
+       key=foo.bar
+       value=from-repo
+       origin=file
+       name=.git/config
+       scope=repo
+
+       key=foo.bar
+       value=from-cmdline
+       origin=command line
+       name=
+       scope=cmdline
+       EOF
+       GIT_CONFIG_PARAMETERS=$cmdline_config test-config iterate >actual &&
+       test_cmp expect actual
+'
+
 test_done