summaryrefslogtreecommitdiff
path: root/t/t1308-config-set.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t1308-config-set.sh')
-rwxr-xr-xt/t1308-config-set.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/t/t1308-config-set.sh b/t/t1308-config-set.sh
index 005d66dbef..cf716b469f 100755
--- a/t/t1308-config-set.sh
+++ b/t/t1308-config-set.sh
@@ -229,4 +229,31 @@ 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 &&
+ 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