aboutsummaryrefslogtreecommitdiffstats
path: root/t/t9211-scalar-clone.sh
diff options
context:
space:
mode:
authorBence Ferdinandy <bence@ferdinandy.com>2024-11-22 13:28:50 +0100
committerJunio C Hamano <gitster@pobox.com>2024-11-25 11:46:37 +0900
commit3f763ddf28d28fe63963991513c8db4045eabadc (patch)
tree128738e283defd82ac8e3155745988a41c74937c /t/t9211-scalar-clone.sh
parent9963746c841dc786529827b7b6755d0a3e208ad4 (diff)
downloadgit-3f763ddf28d28fe63963991513c8db4045eabadc.tar.gz
fetch: set remote/HEAD if it does not exist
When cloning a repository remote/HEAD is created, but when the user creates a repository with git init, and later adds a remote, remote/HEAD is only created if the user explicitly runs a variant of "remote set-head". Attempt to set remote/HEAD during fetch, if the user does not have it already set. Silently ignore any errors. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9211-scalar-clone.sh')
-rwxr-xr-xt/t9211-scalar-clone.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/t/t9211-scalar-clone.sh b/t/t9211-scalar-clone.sh
index 7869f45ee6..01f71910f5 100755
--- a/t/t9211-scalar-clone.sh
+++ b/t/t9211-scalar-clone.sh
@@ -31,7 +31,7 @@ test_expect_success 'set up repository to clone' '
)
'
-cleanup_clone () {
+cleanup_clone() {
rm -rf "$1"
}
@@ -127,7 +127,7 @@ test_expect_success '--single-branch clones HEAD only' '
(
cd $enlistment/src &&
git for-each-ref refs/remotes/origin >out &&
- test_line_count = 1 out &&
+ test_line_count = 2 out &&
grep "refs/remotes/origin/base" out
) &&
@@ -141,7 +141,7 @@ test_expect_success '--no-single-branch clones all branches' '
(
cd $enlistment/src &&
git for-each-ref refs/remotes/origin >out &&
- test_line_count = 2 out &&
+ test_line_count = 3 out &&
grep "refs/remotes/origin/base" out &&
grep "refs/remotes/origin/parallel" out
) &&