From: David Kågedal Date: Wed, 21 Nov 2007 10:35:59 +0000 (+0100) Subject: Added test case for stg refresh X-Git-Tag: v0.14~26 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/commitdiff_plain/38baedf221996ed584d14a561947395656f9c0e5 Added test case for stg refresh Signed-off-by: David Kågedal Signed-off-by: Karl Hasselström --- diff --git a/t/t2700-refresh.sh b/t/t2700-refresh.sh new file mode 100755 index 0000000..2e7901c --- /dev/null +++ b/t/t2700-refresh.sh @@ -0,0 +1,65 @@ +#!/bin/sh + +test_description='Run "stg refresh"' + +. ./test-lib.sh + +test_expect_success 'Initialize StGit stack' ' + stg init && + echo expected.txt >> .git/info/exclude && + echo patches.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 + done + stg refresh && + for i in 1 2 3; do + stg new p$i -m "foo $i" && + echo "foo $i" >> foo$i.txt && + stg refresh + done +' + +cat > expected.txt <> foo3.txt && + stg refresh && + stg status && + test -z "$(stg status)" && + stg patches foo3.txt > patches.txt && + diff -u expected.txt patches.txt +' + +cat > expected.txt <> foo2.txt && + stg refresh -p p2 && + stg status && + test -z "$(stg status)" && + stg patches foo2.txt > patches.txt && + diff -u expected.txt patches.txt +' + +cat > expected.txt <> foo1.txt && + stg refresh -p p1 && + stg status && + test -z "$(stg status)" && + stg patches foo1.txt > patches.txt && + diff -u expected.txt patches.txt +' + +test_done