check-attr: the name of the character is NUL, not NULL
[gitweb.git] / git-difftool--helper.sh
index e6558d101062929241cc30cd0272556c3164310b..b00ed95dba9c035ee812d3a2d6db2d13a1944a33 100755 (executable)
@@ -40,7 +40,7 @@ launch_merge_tool () {
        # the user with the real $MERGED name before launching $merge_tool.
        if should_prompt
        then
-               printf "\nViewing: '$MERGED'\n"
+               printf "\nViewing: '%s'\n" "$MERGED"
                if use_ext_cmd
                then
                        printf "Launch '%s' [Y/n]: " \
@@ -73,9 +73,16 @@ then
        fi
 fi
 
-# Launch the merge tool on each path provided by 'git diff'
-while test $# -gt 6
-do
-       launch_merge_tool "$1" "$2" "$5"
-       shift 7
-done
+if test -n "$GIT_DIFFTOOL_DIRDIFF"
+then
+       LOCAL="$1"
+       REMOTE="$2"
+       run_merge_tool "$merge_tool" false
+else
+       # Launch the merge tool on each path provided by 'git diff'
+       while test $# -gt 6
+       do
+               launch_merge_tool "$1" "$2" "$5"
+               shift 7
+       done
+fi