From: David Aguilar Date: Fri, 15 Jan 2010 22:03:42 +0000 (-0800) Subject: t7800-difftool.sh: Simplify the --extcmd test X-Git-Tag: v1.7.0-rc0~67^2~3 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a9e11220c2656cc5d7baac4d0735c04f9be46438;p=git.git t7800-difftool.sh: Simplify the --extcmd test Instead of running 'grep', 'echo', and 'wc' we simply compare git-difftool's output against a known good value. Signed-off-by: David Aguilar Signed-off-by: Junio C Hamano --- diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh index 8ee186a5f..1d9e07b0d 100755 --- a/t/t7800-difftool.sh +++ b/t/t7800-difftool.sh @@ -15,6 +15,9 @@ if ! test_have_prereq PERL; then test_done fi +LF=' +' + remove_config_vars() { # Unset all config variables used by git-difftool @@ -219,19 +222,13 @@ test_expect_success 'difftool..path' ' restore_test_defaults ' -test_expect_success 'difftool --extcmd=...' ' +test_expect_success 'difftool --extcmd=cat' ' diff=$(git difftool --no-prompt --extcmd=cat branch) && + test "$diff" = branch"$LF"master - lines=$(echo "$diff" | wc -l) && - test "$lines" -eq 2 && - lines=$(echo "$diff" | grep master | wc -l) && - test "$lines" -eq 1 && - lines=$(echo "$diff" | grep branch | wc -l) && - test "$lines" -eq 1 && - restore_test_defaults ' test_done