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