summaryrefslogtreecommitdiff
path: root/gitweb
diff options
context:
space:
mode:
authorJakub Narebski <jnareb@gmail.com>2007-04-05 11:45:41 (GMT)
committerJunio C Hamano <junkio@cox.net>2007-04-05 21:14:55 (GMT)
commit957d6ea78fcbe71481a6f46a58768e100f7908e0 (patch)
tree3f17d54e6ef33bdbe6ce7d3a707e98a85d558a90 /gitweb
parentb24bace5ca9420033be83ef6c14fb092c9371fe1 (diff)
downloadgit-957d6ea78fcbe71481a6f46a58768e100f7908e0.zip
git-957d6ea78fcbe71481a6f46a58768e100f7908e0.tar.gz
git-957d6ea78fcbe71481a6f46a58768e100f7908e0.tar.bz2
gitweb: Fix bug in "blobdiff" view for split (e.g. file to symlink) patches
git_patchset_body needs patch generated with --full-index option to detect split patches, meaning two patches which corresponds to single difftree (raw diff) entry. An example of such situation is changing type (mode) of a file, e.g. from plain file to symbolic link. Add, in git_blobdiff, --full-index option to patch generating git diff invocation, for the 'html' format output ("blobdiff" view). "blobdiff_plain" still uses shortened sha1 in the extended git diff header "index <hash>..<hash>[ <mode>]" line. Noticed-by: Martin Koegler <mkoegler@auto.tuwien.ac.at> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'gitweb')
-rwxr-xr-xgitweb/gitweb.perl6
1 files changed, 4 insertions, 2 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 3786955..45ac9d7 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -3934,7 +3934,8 @@ sub git_blobdiff {
# open patch output
open $fd, "-|", git_cmd(), "diff-tree", '-r', @diff_opts,
- '-p', $hash_parent_base, $hash_base,
+ '-p', ($format eq 'html' ? "--full-index" : ()),
+ $hash_parent_base, $hash_base,
"--", (defined $file_parent ? $file_parent : ()), $file_name
or die_error(undef, "Open git-diff-tree failed");
}
@@ -3969,7 +3970,8 @@ sub git_blobdiff {
}
# open patch output
- open $fd, "-|", git_cmd(), "diff", '-p', @diff_opts,
+ open $fd, "-|", git_cmd(), "diff", @diff_opts,
+ '-p', ($format eq 'html' ? "--full-index" : ()),
$hash_parent, $hash, "--"
or die_error(undef, "Open git-diff failed");
} else {