3 test_description
='Run "stg goto" in a subdirectory'
7 test_expect_success
'Initialize StGit stack' '
9 echo expected1.txt >> .git/info/exclude &&
10 echo expected2.txt >> .git/info/exclude &&
11 echo actual.txt >> .git/info/exclude &&
14 echo foo$i >> foo/bar &&
21 cat > expected1.txt
<<EOF
24 cat > expected2.txt
<<EOF
27 test_expect_success
'Goto in subdirectory (just pop)' '
28 (cd foo && stg goto p1) &&
29 cat foo/bar > actual.txt &&
30 test_cmp expected1.txt actual.txt &&
31 ls foo > actual.txt &&
32 test_cmp expected2.txt actual.txt
35 test_expect_success
'Prepare conflicting goto' '
39 cat > expected1.txt
<<EOF
41 <<<<<<< current:foo/bar
45 >>>>>>> patched:foo/bar
47 cat > expected2.txt
<<EOF
50 test_expect_success
'Goto in subdirectory (conflicting push)' '
51 (cd foo && stg goto p3) ;
53 cat foo/bar > actual.txt &&
54 test_cmp expected1.txt actual.txt &&
55 ls foo > actual.txt &&
56 test_cmp expected2.txt actual.txt