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>
Junio C Hamano committed
Sep 27, 2007 at 14:41 UTC
769f39861b73a374f116fcb913e5ff276fe92751
1 file changed
+4
-3
git-mergetool.sh
+4
-3
@@ -12,6 +12,7 @@ USAGE='[--tool=tool] [file to merge] ...'
12
SUBDIRECTORY_OK=Yes
13
. git-sh-setup
14
require_work_tree
15
+prefix=$(git rev-parse --show-prefix)
16
17
# Returns true if the mode reflects a symlink
18
is_symlink () {
@@ -162,9 +163,9 @@ merge_file () {
163
local_mode=`git ls-files -u -- "$path" | awk '{if ($3==2) print $1;}'`
164
remote_mode=`git ls-files -u -- "$path" | awk '{if ($3==3) print $1;}'`
165
165
- base_present && git cat-file blob ":1:$path" > "$BASE" 2>/dev/null
166
- local_present && git cat-file blob ":2:$path" > "$LOCAL" 2>/dev/null
167
- remote_present && git cat-file blob ":3:$path" > "$REMOTE" 2>/dev/null
166
+ base_present && git cat-file blob ":1:$prefix$path" >"$BASE" 2>/dev/null
167
+ local_present && git cat-file blob ":2:$prefix$path" >"$LOCAL" 2>/dev/null
168
+ remote_present && git cat-file blob ":3:$prefix$path" >"$REMOTE" 2>/dev/null
169
170
if test -z "$local_mode" -o -z "$remote_mode"; then
171
echo "Deleted merge conflict for '$path':"