difftool: teach difftool to handle directory diffs
[gitweb.git] / t / t7800-difftool.sh
index e716d066c9ae0f4dc709d30aa7269ed6e306fbdf..478c1bef375c0529a338b07e6e71669fa34bb7f2 100755 (executable)
@@ -319,4 +319,43 @@ test_expect_success PERL 'say no to the second file' '
        echo "$diff" | stdin_doesnot_contain br2
 '
 
+test_expect_success PERL 'setup change in subdirectory' '
+       git checkout master &&
+       mkdir sub &&
+       echo master >sub/sub &&
+       git add sub/sub &&
+       git commit -m "added sub/sub" &&
+       echo test >>file &&
+       echo test >>sub/sub &&
+       git add . &&
+       git commit -m "modified both"
+'
+
+test_expect_success PERL 'difftool -d' '
+       diff=$(git difftool -d --extcmd ls branch) &&
+       echo "$diff" | stdin_contains sub &&
+       echo "$diff" | stdin_contains file
+'
+
+test_expect_success PERL 'difftool --dir-diff' '
+       diff=$(git difftool --dir-diff --extcmd ls branch) &&
+       echo "$diff" | stdin_contains sub &&
+       echo "$diff" | stdin_contains file
+'
+
+test_expect_success PERL 'difftool --dir-diff ignores --prompt' '
+       diff=$(git difftool --dir-diff --prompt --extcmd ls branch) &&
+       echo "$diff" | stdin_contains sub &&
+       echo "$diff" | stdin_contains file
+'
+
+test_expect_success PERL 'difftool --dir-diff from subdirectory' '
+       (
+               cd sub &&
+               diff=$(git difftool --dir-diff --extcmd ls branch) &&
+               echo "$diff" | stdin_contains sub &&
+               echo "$diff" | stdin_contains file
+       )
+'
+
 test_done