]>
Commit | Line | Data |
---|---|---|
efb98b44 DL |
1 | #!/bin/sh |
2 | # | |
3 | # Copyright (c) 2008 Dmitry V. Levin | |
4 | # | |
5 | ||
6 | test_description='fetch exit status test' | |
7 | ||
bc925ce3 | 8 | GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main |
334afbc7 JS |
9 | export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME |
10 | ||
7a98d9ab | 11 | TEST_PASSES_SANITIZE_LEAK=true |
efb98b44 DL |
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 | ||
bc925ce3 | 24 | git checkout main && |
efb98b44 DL |
25 | echo next >file && |
26 | git commit -a -m next | |
27 | ' | |
28 | ||
a75d7b54 | 29 | test_expect_success 'non-fast-forward fetch' ' |
efb98b44 | 30 | |
bc925ce3 | 31 | test_must_fail git fetch . main:side |
efb98b44 DL |
32 | |
33 | ' | |
34 | ||
35 | test_expect_success 'forced update' ' | |
36 | ||
bc925ce3 | 37 | git fetch . +main:side |
efb98b44 DL |
38 | |
39 | ' | |
40 | ||
41 | test_done |