mergetool: fix emerge when running in a subdirectory
authorTheodore Ts'o <tytso@mit.edu>
Sat, 29 Sep 2007 01:23:22 +0000 (21:23 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 29 Sep 2007 01:23:22 +0000 (21:23 -0400)
Only pass the basename of the output filename when to emerge, since
emerge interprets non-absolute pathnames relative to the containing
directory of the output buffer.

Thanks to Kelvie Wong for pointing this out.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
git-mergetool.sh
index e00682a513d1e8ea438b2ecedb2c6f3652a2c588..a92019a1ed01e7f88145576f518f37fe7f8678bd 100755 (executable)
@@ -252,9 +252,9 @@ merge_file () {
            ;;
        emerge)
            if base_present ; then
-               emacs -f emerge-files-with-ancestor-command "$LOCAL" "$REMOTE" "$BASE" "$path"
+               emacs -f emerge-files-with-ancestor-command "$LOCAL" "$REMOTE" "$BASE" "$(basename "$path")"
            else
-               emacs -f emerge-files-command "$LOCAL" "$REMOTE" "$path"
+               emacs -f emerge-files-command "$LOCAL" "$REMOTE" "$(basename "$path")"
            fi
            status=$?
            save_backup