gitignore: Add ChangeLog to .gitignore
[stgit.git] / t / t2701-refresh-p.sh
blob3ba3b029546e4ac6055190515e25c9474679f7d1
1 #!/bin/sh
3 test_description='Run "stg refresh -p"'
5 . ./test-lib.sh
7 # Ignore our own temp files.
8 cat >> .git/info/exclude <<EOF
9 expected*.txt
10 files*.txt
11 status*.txt
12 EOF
14 test_expect_success 'Initialize StGit stack' '
15 stg init &&
16 for i in 1 2; do
17 echo x > $i.txt &&
18 stg add $i.txt &&
19 stg new p$i -m "Patch $i" &&
20 stg refresh
21 done
24 touch expected0.txt
25 cat > expected1.txt <<EOF
26 A 1.txt
27 A new.txt
28 EOF
29 cat > expected2.txt <<EOF
30 A 2.txt
31 EOF
32 test_expect_success 'Add new file to non-top patch' '
33 stg status > status1.txt &&
34 test_cmp expected0.txt status1.txt &&
35 echo y > new.txt &&
36 stg add new.txt &&
37 stg refresh -p p1 &&
38 stg status > status2.txt &&
39 test_cmp expected0.txt status2.txt &&
40 stg files p1 > files1.txt &&
41 test_cmp expected1.txt files1.txt &&
42 stg files p2 > files2.txt &&
43 test_cmp expected2.txt files2.txt
46 test_done