X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/38baedf221996ed584d14a561947395656f9c0e5..de8efe1efc4a495eca0614aa9f6c1910d5838f99:/t/t2700-refresh.sh diff --git a/t/t2700-refresh.sh b/t/t2700-refresh.sh index 2e7901c..6028b9e 100755 --- a/t/t2700-refresh.sh +++ b/t/t2700-refresh.sh @@ -6,12 +6,14 @@ test_description='Run "stg refresh"' test_expect_success 'Initialize StGit stack' ' stg init && - echo expected.txt >> .git/info/exclude && + echo expected*.txt >> .git/info/exclude && echo patches.txt >> .git/info/exclude && + echo show.txt >> .git/info/exclude && + echo diff.txt >> .git/info/exclude && stg new p0 -m "base" && for i in 1 2 3; do echo base >> foo$i.txt && - git add foo$i.txt + stg add foo$i.txt done stg refresh && for i in 1 2 3; do @@ -31,7 +33,7 @@ test_expect_success 'Refresh top patch' ' stg status && test -z "$(stg status)" && stg patches foo3.txt > patches.txt && - diff -u expected.txt patches.txt + test_cmp expected.txt patches.txt ' cat > expected.txt < patches.txt && - diff -u expected.txt patches.txt + test_cmp expected.txt patches.txt ' cat > expected.txt < patches.txt && - diff -u expected.txt patches.txt + test_cmp expected.txt patches.txt +' + +cat > expected.txt < expected2.txt < expected3.txt <> foo1.txt && + stg add foo1.txt && + echo blah 1 >> foo1.txt && + echo baz 2 >> foo2.txt && + stg refresh --index && + stg patches foo1.txt > patches.txt && + git diff HEAD^..HEAD > show.txt && + stg diff > diff.txt && + test_cmp expected.txt patches.txt && + test_cmp expected2.txt show.txt && + test_cmp expected3.txt diff.txt && + stg new p5 -m "cleanup again" && + stg refresh +' + +test_expect_success 'Refresh moved files' ' + stg mv foo1.txt foo1-new.txt && + stg refresh ' test_done