diff options
author | Tim Henigan <tim.henigan@gmail.com> | 2012-04-23 14:23:41 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-04-23 11:59:34 -0700 |
commit | 7e0abcec103b3649943b236881cf88e8fd6cf3a4 (patch) | |
tree | 99936329de9603b8284f7d0eda6d2b09c5723193 /t/t7800-difftool.sh | |
parent | e9653615fafcbac6109da99fac4fa66b0b432048 (diff) | |
download | git-7e0abcec103b3649943b236881cf88e8fd6cf3a4.tar.gz |
difftool: teach difftool to handle directory diffs
When 'difftool' is called to compare a range of commits that modify
more than one file, it opens a separate instance of the diff tool for
each file that changed.
The new '--dir-diff' option copies all the modified files to a temporary
location and runs a directory diff on them in a single instance of the
diff tool.
Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7800-difftool.sh')
-rwxr-xr-x | t/t7800-difftool.sh | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh index e716d066c9..478c1bef37 100755 --- a/t/t7800-difftool.sh +++ b/t/t7800-difftool.sh @@ -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 |