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
13 # Need a repo to clone
14 test_create_repo upstream
17 'Setup upstream repo, clone it, and add patches to the clone' \
19 (cd upstream && stg init) &&
20 stg clone upstream clone &&
22 git config branch.master.stgit.pull-policy fetch-rebase &&
25 echo a > file && git add file && stg refresh
30 'Add non-rewinding commit upstream and pull it from clone' \
32 (cd upstream && stg new u1 -m u1 &&
33 echo a > file2 && git add file2 && stg refresh) &&
34 (cd clone && stg pull) &&
38 # note: with pre-1.5 Git the clone is not automatically recorded
39 # as rewinding, and thus heads/origin is not moved, but the stack
40 # is still correctly rebased
42 'Rewind/rewrite upstream commit and pull it from clone' \
44 (cd upstream && echo b >> file2 && stg refresh) &&
45 (cd clone && stg pull) &&
46 test `wc -l <clone/file2` = 2
49 # this one ensures the guard against commits does not unduly trigger
51 'Rewind/rewrite upstream commit and fetch it from clone before pulling' \
53 (cd upstream && echo c >> file2 && stg refresh) &&
54 (cd clone && git fetch && stg pull) &&
55 test `wc -l <clone/file2` = 3