summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 83543a2)
raw | patch | inline | side by side (parent: 83543a2)
author | Petr Baudis <pasky@suse.cz> | |
Tue, 24 Oct 2006 00:39:14 +0000 (02:39 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 24 Oct 2006 02:21:05 +0000 (19:21 -0700) |
If the commit couldn't have been read, $/ wasn't restored to \n properly,
causing random havoc like git_get_ref_list() returning the ref names with
trailing \n.
Aside of potential confusion in the body of git_search(), no other $/
surprises are hopefully hidden in the code.
Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
causing random havoc like git_get_ref_list() returning the ref names with
trailing \n.
Aside of potential confusion in the body of git_search(), no other $/
surprises are hopefully hidden in the code.
Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
gitweb/gitweb.perl | patch | blob | history |
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 23b26a2db217cd561e56716ce6b6495a4974ab9c..2390603e97a970f47a6f54466e92483ea2649da3 100755 (executable)
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
if (defined $commit_text) {
@commit_lines = @$commit_text;
} else {
- $/ = "\0";
+ local $/ = "\0";
open my $fd, "-|", git_cmd(), "rev-list", "--header", "--parents", "--max-count=1", $commit_id
or return;
@commit_lines = split '\n', <$fd>;
close $fd or return;
- $/ = "\n";
pop @commit_lines;
}
my $header = shift @commit_lines;