summaryrefslogtreecommitdiff
path: root/git-mergetool.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-09-27 14:41:23 -0700
committerTheodore Ts'o <tytso@mit.edu>2007-09-28 20:13:14 -0400
commit769f39861b73a374f116fcb913e5ff276fe92751 (patch)
treec4adbc44e960d041fefdd4c40c167718849b77eb /git-mergetool.sh
parent26b28007689d27a921ea90e5a29fc8eb74b0d297 (diff)
downloadgit-769f39861b73a374f116fcb913e5ff276fe92751.tar.gz
Mergetool generating blank files (1.5.3)
When mergetool is run from a subdirectory, "ls-files -u" nicely limits the output to conflicted files in that directory, but we need to give the full path to cat-file plumbing to grab the contents of stages. Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'git-mergetool.sh')
-rwxr-xr-xgit-mergetool.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/git-mergetool.sh b/git-mergetool.sh
index a0e44f71c4..e00682a513 100755
--- a/git-mergetool.sh
+++ b/git-mergetool.sh
@@ -12,6 +12,7 @@ USAGE='[--tool=tool] [file to merge] ...'
SUBDIRECTORY_OK=Yes
. git-sh-setup
require_work_tree
+prefix=$(git rev-parse --show-prefix)
# Returns true if the mode reflects a symlink
is_symlink () {
@@ -162,9 +163,9 @@ merge_file () {
local_mode=`git ls-files -u -- "$path" | awk '{if ($3==2) print $1;}'`
remote_mode=`git ls-files -u -- "$path" | awk '{if ($3==3) print $1;}'`
- base_present && git cat-file blob ":1:$path" > "$BASE" 2>/dev/null
- local_present && git cat-file blob ":2:$path" > "$LOCAL" 2>/dev/null
- remote_present && git cat-file blob ":3:$path" > "$REMOTE" 2>/dev/null
+ base_present && git cat-file blob ":1:$prefix$path" >"$BASE" 2>/dev/null
+ local_present && git cat-file blob ":2:$prefix$path" >"$LOCAL" 2>/dev/null
+ remote_present && git cat-file blob ":3:$prefix$path" >"$REMOTE" 2>/dev/null
if test -z "$local_mode" -o -z "$remote_mode"; then
echo "Deleted merge conflict for '$path':"