Test for generated patchname with trailing period
[stgit.git] / t / t2102-pull-policy-rebase.sh
blobdfd053f3d75929271244c2cec39082865c74da56
1 #!/bin/sh
3 # Copyright (c) 2007 Yann Dirson
6 test_description='Excercise pull-policy "rebase".'
8 . ./test-lib.sh
10 test_expect_success \
11 'Fork stack off parent branch, and add patches to the stack' \
13 git branch -m master parent &&
14 stg init &&
15 stg branch --create stack &&
16 git config branch.stack.stgit.pull-policy rebase &&
17 git config --list &&
18 stg new c1 -m c1 &&
19 echo a > file && stg add file && stg refresh
22 test_expect_success \
23 'Test invalid remote argument' \
25 command_error stg pull origin 2>&1 | \
26 grep "specifying a repository is meaningless for policy=\"rebase\""
29 test_expect_success \
30 'Test invalid arguments' \
32 command_error stg pull origin master 2>&1 | \
33 grep "incorrect number of arguments"
36 test_expect_success \
37 'Add non-rewinding commit in parent and pull the stack' \
39 stg branch parent && stg new u1 -m u1 &&
40 echo b > file2 && stg add file2 && stg refresh &&
41 stg branch stack && stg pull &&
42 test_path_is_file file2
45 test_expect_success \
46 'Rewind/rewrite commit in parent and pull the stack' \
48 stg branch parent && echo b >> file2 && stg refresh &&
49 stg branch stack && stg pull &&
50 test_line_count = 2 file2
53 test_done