Merge branch 'da/difftool' into maint
authorJunio C Hamano <gitster@pobox.com>
Mon, 6 Jun 2016 21:27:37 +0000 (14:27 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 6 Jun 2016 21:27:37 +0000 (14:27 -0700)
"git difftool" learned to handle unmerged paths correctly in
dir-diff mode.

* da/difftool:
difftool: handle unmerged files in dir-diff mode
difftool: initialize variables for readability

1  2 
t/t7800-difftool.sh
diff --combined t/t7800-difftool.sh
index ff7a9e968f4dde078a131ee65306ae6784e8faa5,6a7207b9506d76beed912698be63afffcd503991..7ce4cd753eb0c50f42b68653da79f90b19edd764
@@@ -20,7 -20,7 +20,7 @@@ difftool_test_setup (
  prompt_given ()
  {
        prompt="$1"
 -      test "$prompt" = "Launch 'test-tool' [Y/n]: branch"
 +      test "$prompt" = "Launch 'test-tool' [Y/n]? branch"
  }
  
  # Create a file on master and change it on branch
@@@ -419,6 -419,29 +419,29 @@@ run_dir_diff_test 'difftool --dir-diff 
        grep file2 output
  '
  
+ run_dir_diff_test 'difftool --dir-diff with unmerged files' '
+       test_when_finished git reset --hard &&
+       test_config difftool.echo.cmd "echo ok" &&
+       git checkout -B conflict-a &&
+       git checkout -B conflict-b &&
+       git checkout conflict-a &&
+       echo a >>file &&
+       git add file &&
+       git commit -m conflict-a &&
+       git checkout conflict-b &&
+       echo b >>file &&
+       git add file &&
+       git commit -m conflict-b &&
+       git checkout master &&
+       git merge conflict-a &&
+       test_must_fail git merge conflict-b &&
+       cat >expect <<-EOF &&
+               ok
+       EOF
+       git difftool --dir-diff $symlinks -t echo >actual &&
+       test_cmp expect actual
+ '
  write_script .git/CHECK_SYMLINKS <<\EOF
  for f in file file2 sub/sub
  do