]> git.ipfire.org Git - thirdparty/git.git/blob - t/t5518-fetch-exit-status.sh
Sync with Git 2.45.1
[thirdparty/git.git] / t / t5518-fetch-exit-status.sh
1 #!/bin/sh
2 #
3 # Copyright (c) 2008 Dmitry V. Levin
4 #
5
6 test_description='fetch exit status test'
7
8 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
9 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
10
11 TEST_PASSES_SANITIZE_LEAK=true
12 . ./test-lib.sh
13
14 test_expect_success setup '
15
16 >file &&
17 git add file &&
18 git commit -m initial &&
19
20 git checkout -b side &&
21 echo side >file &&
22 git commit -a -m side &&
23
24 git checkout main &&
25 echo next >file &&
26 git commit -a -m next
27 '
28
29 test_expect_success 'non-fast-forward fetch' '
30
31 test_must_fail git fetch . main:side
32
33 '
34
35 test_expect_success 'forced update' '
36
37 git fetch . +main:side
38
39 '
40
41 test_done