3 # Copyright (c) 2007 Yann Dirson
6 test_description
='Excercise pull-policy "fetch-rebase".'
10 # don't need this repo, but better not drop it, see t1100
14 'Setup upstream repo, clone it, and add patches to the clone' \
16 test_create_repo upstream &&
17 (cd upstream && stg init) &&
18 stg clone upstream clone &&
20 git config pull.rebase false &&
21 git config branch.master.stgit.pull-policy pull &&
24 echo a > file && stg add file && stg refresh
31 stg branch --protect &&
32 command_error stg pull 2>&1 |
33 grep "This branch is protected" &&
34 stg branch --unprotect
39 'Add non-rewinding commit upstream and pull it from clone' \
41 (cd upstream && stg new u1 -m u1 &&
42 echo a > file2 && stg add file2 && stg refresh) &&
43 (cd clone && stg pull) &&
44 test_path_is_file clone/file2 &&
45 test_path_is_file clone/file
49 'Test too many arguments' \
53 command_error stg pull origin master 2>&1 | \
54 grep "incorrect number of arguments"
59 'Test invalid pull policy' \
61 test_config -C clone branch.master.stgit.pull-policy bogus &&
64 command_error stg pull 2>&1 | grep "Unsupported pull-policy"
68 # note: with pre-1.5 Git the clone is not automatically recorded
69 # as rewinding, and thus heads/origin is not moved, but the stack
70 # is still correctly rebased
73 'Rewind/rewrite upstream commit and pull it from clone, without --merged' \
82 conflict stg pull origin
87 '"Solve" the conflict (pretend there is none)' \
95 'Push the stack back' \
96 '(cd clone && stg push -a)'
99 'Exercise stgit.keepoptimized' \
101 test_config -C clone stgit.keepoptimized true &&