X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fgit.git;a=blobdiff_plain;f=t%2Ft7800-difftool.sh;fp=t%2Ft7800-difftool.sh;h=3e041e83aede07ead62d54cc9a9b485b8eaeda0f;hp=9192c141ffc618f70e15b7cf25883d55469e5c11;hb=6eea44cee1dc94a7d6f7fa768d5710f9385f22db;hpb=ccf6861b7272f99ab078345e1ee6d6b37b742cc0 diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh index 9192c141ff..3e041e83ae 100755 --- a/t/t7800-difftool.sh +++ b/t/t7800-difftool.sh @@ -762,4 +762,36 @@ test_expect_success 'difftool --gui, --tool and --extcmd are mutually exclusive' test_must_fail git difftool --gui --tool=test-tool --extcmd=cat ' +test_expect_success 'difftool --rotate-to' ' + difftool_test_setup && + test_when_finished git reset --hard && + echo 1 >1 && + echo 2 >2 && + echo 4 >4 && + git add 1 2 4 && + git commit -a -m "124" && + git difftool --no-prompt --extcmd=cat --rotate-to="2" HEAD^ >output&& + cat >expect <<-\EOF && + 2 + 4 + 1 + EOF + test_cmp output expect +' + +test_expect_success 'difftool --skip-to' ' + difftool_test_setup && + test_when_finished git reset --hard && + git difftool --no-prompt --extcmd=cat --skip-to="2" HEAD^ >output && + cat >expect <<-\EOF && + 2 + 4 + EOF + test_cmp output expect +' + +test_expect_success 'difftool --rotate/skip-to error condition' ' + test_must_fail git difftool --no-prompt --extcmd=cat --rotate-to="3" HEAD^ && + test_must_fail git difftool --no-prompt --extcmd=cat --skip-to="3" HEAD^ +' test_done