Skip to content

Commit 63ec97f

Browse files
peffgitster
authored andcommitted
t5553: use local url for invalid fetch
We test how "fetch --set-upstream" behaves when given an invalid URL, using the bogus URL "http://nosuchdomain.example.com". But finding out that it is invalid requires an actual DNS lookup. Reduce our dependency on external factors by using an invalid local filesystem URL, which works just as well for our purposes. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 786a3e4 commit 63ec97f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

t/t5553-set-upstream.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ test_expect_success 'fetch --set-upstream main:other does not set the branch oth
7373
check_config_missing other2
7474
'
7575

76-
test_expect_success 'fetch --set-upstream http://nosuchdomain.example.com fails with invalid url' '
76+
test_expect_success 'fetch --set-upstream ./does-not-exist fails with invalid url' '
7777
# main explicitly not cleared, we check that it is not touched from previous value
7878
clear_config other other2 &&
79-
test_must_fail git fetch --set-upstream http://nosuchdomain.example.com &&
79+
test_must_fail git fetch --set-upstream ./does-not-exist &&
8080
check_config main upstream refs/heads/other &&
8181
check_config_missing other &&
8282
check_config_missing other2
@@ -143,10 +143,10 @@ test_expect_success 'pull --set-upstream upstream tag does not set the tag' '
143143
check_config_missing three
144144
'
145145

146-
test_expect_success 'pull --set-upstream http://nosuchdomain.example.com fails with invalid url' '
146+
test_expect_success 'pull --set-upstream ./does-not-exist fails with invalid url' '
147147
# main explicitly not cleared, we check that it is not touched from previous value
148148
clear_config other other2 three &&
149-
test_must_fail git pull --set-upstream http://nosuchdomain.example.com &&
149+
test_must_fail git pull --set-upstream ./does-not-exist &&
150150
check_config main upstream refs/heads/other &&
151151
check_config_missing other &&
152152
check_config_missing other2 &&

0 commit comments

Comments
 (0)