aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorBence Ferdinandy <bence@ferdinandy.com>2024-12-05 13:16:22 +0100
committerJunio C Hamano <gitster@pobox.com>2024-12-06 02:59:40 +0900
commit012bc566bad79876f4809d1e730a348b419772d0 (patch)
treefe711e3876917ee28f1b522158ed41f7608c84d2 /t
parent9e2b7005becaf730ff75f6efbef4542cc4454107 (diff)
downloadgit-012bc566bad79876f4809d1e730a348b419772d0.tar.gz
remote set-head: set followRemoteHEAD to "warn" if "always"
When running "remote set-head" manually it is unlikely, that the user would actually like to have "fetch" always update the remote/HEAD. On the contrary, it is more likely, that the user would expect remote/HEAD to stay the way they manually set it, and just forgot about having "followRemoteHEAD" set to "always". When "followRemoteHEAD" is set to "always" make running "remote set-head" change the config to "warn". Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t5505-remote.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index 2600add82a..93240a3602 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -505,6 +505,17 @@ test_expect_success 'set-head --auto has no problem w/multiple HEADs' '
)
'
+test_expect_success 'set-head changes followRemoteHEAD always to warn' '
+ (
+ cd test &&
+ git config set remote.origin.followRemoteHEAD "always" &&
+ git remote set-head --auto origin &&
+ git config get remote.origin.followRemoteHEAD >actual &&
+ echo "warn" >expect &&
+ test_cmp expect actual
+ )
+'
+
cat >test/expect <<\EOF
refs/remotes/origin/side2
EOF