Merge branch 'jk/difftool-in-subdir'
authorJunio C Hamano <gitster@pobox.com>
Mon, 8 Aug 2016 21:48:39 +0000 (14:48 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 8 Aug 2016 21:48:39 +0000 (14:48 -0700)
"git difftool <paths>..." started in a subdirectory failed to
interpret the paths relative to that directory, which has been
fixed.

* jk/difftool-in-subdir:
difftool: use Git::* functions instead of passing around state
difftool: avoid $GIT_DIR and $GIT_WORK_TREE
difftool: fix argument handling in subdirs

1  2 
t/t7800-difftool.sh
diff --combined t/t7800-difftool.sh
index 42a2929835b5c77e5b3031ce56ad1243afb56971,cb25480e1f7282abf93d1dc2b4d3a914a3d8a40d..2974900578d3f21b57d5773973344a1743e8e6e0
@@@ -412,6 -412,20 +412,20 @@@ run_dir_diff_test 'difftool --dir-diff 
        )
  '
  
+ run_dir_diff_test 'difftool --dir-diff from subdirectory with GIT_DIR set' '
+       (
+               GIT_DIR=$(pwd)/.git &&
+               export GIT_DIR &&
+               GIT_WORK_TREE=$(pwd) &&
+               export GIT_WORK_TREE &&
+               cd sub &&
+               git difftool --dir-diff $symlinks --extcmd ls \
+                       branch -- sub >output &&
+               grep sub output &&
+               ! grep file output
+       )
+ '
  run_dir_diff_test 'difftool --dir-diff when worktree file is missing' '
        test_when_finished git reset --hard &&
        rm file2 &&
@@@ -446,7 -460,7 +460,7 @@@ write_script .git/CHECK_SYMLINKS <<\EO
  for f in file file2 sub/sub
  do
        echo "$f"
 -      readlink "$2/$f"
 +      ls -ld "$2/$f" | sed -e 's/.* -> //'
  done >actual
  EOF