From: Karl Hasselström Date: Sun, 21 Sep 2008 12:17:42 +0000 (+0200) Subject: New refresh tests X-Git-Tag: v0.15-rc1~134 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/commitdiff_plain/b7e3c8c0b4cc0469eeb00ef00cfcf02528faed90 New refresh tests Test stg refresh more extensively -- including some things it only recently learned to do. Signed-off-by: Karl Hasselström --- diff --git a/t/t2300-refresh-subdir.sh b/t/t2300-refresh-subdir.sh index 92c1cc8..d731a11 100755 --- a/t/t2300-refresh-subdir.sh +++ b/t/t2300-refresh-subdir.sh @@ -4,7 +4,7 @@ test_description='Test the refresh command from a subdirectory' stg init test_expect_success 'Refresh from a subdirectory' ' - stg new foo -m foo && + stg new p0 -m p0 && echo foo >> foo.txt && mkdir bar && echo bar >> bar/bar.txt && @@ -45,4 +45,31 @@ test_expect_success 'Refresh subdirectories recursively' ' [ "$(stg status)" = "" ] ' +test_expect_success 'refresh -u' ' + echo baz >> bar/baz.txt && + stg new p1 -m p1 && + git add bar/baz.txt && + stg refresh --index && + echo xyzzy >> foo.txt && + echo xyzzy >> bar/bar.txt && + echo xyzzy >> bar/baz.txt && + stg refresh -u && + test "$(echo $(stg status))" = "M bar/bar.txt M foo.txt" +' + +test_expect_success 'refresh -u -p ' ' + echo xyzzy >> bar/baz.txt && + stg refresh -p p0 -u bar && + test "$(echo $(stg status))" = "M bar/baz.txt M foo.txt" +' + +test_expect_success 'refresh an unapplied patch' ' + stg refresh -u && + stg goto p0 && + test "$(stg status)" = "M foo.txt" && + stg refresh -p p1 && + test "$(stg status)" = "" && + test "$(echo $(stg files p1))" = "A bar/baz.txt M foo.txt" +' + test_done