Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
* maint:
  t/t7500-commit.sh: use test_cmp instead of test
  t/gitweb-lib.sh: Ensure that errors are shown for --debug --immediate
  gitweb/gitweb.perl: don't call S_ISREG() with undef
  gitweb/gitweb.perl: remove use of qw(...) as parentheses
  • Loading branch information
Junio C Hamano committed Feb 22, 2011
2 parents 5673d69 + d5a719e commit a66cee2
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 92 deletions.
6 changes: 3 additions & 3 deletions gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -3501,7 +3501,7 @@ sub print_feed_meta {
$href_params{'-title'} = 'log';
}

foreach my $format qw(RSS Atom) {
foreach my $format (qw(RSS Atom)) {
my $type = lc($format);
my %link_attr = (
'-rel' => 'alternate',
Expand Down Expand Up @@ -3682,7 +3682,7 @@ sub git_footer_html {
}
$href_params{'-title'} ||= 'log';

foreach my $format qw(RSS Atom) {
foreach my $format (qw(RSS Atom)) {
$href_params{'action'} = lc($format);
print $cgi->a({-href => href(%href_params),
-title => "$href_params{'-title'} $format feed",
Expand Down Expand Up @@ -4412,7 +4412,7 @@ sub git_difftree_body {
}
if ($diff->{'from_mode'} ne ('0' x 6)) {
$from_mode_oct = oct $diff->{'from_mode'};
if (S_ISREG($to_mode_oct)) { # only for regular file
if (S_ISREG($from_mode_oct)) { # only for regular file
$from_mode_str = sprintf("%04o", $from_mode_oct & 0777); # permission bits
}
$from_file_type = file_type($diff->{'from_mode'});
Expand Down
7 changes: 6 additions & 1 deletion t/gitweb-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ gitweb_run () {
}
close O;
' gitweb.output &&
if grep '^[[]' gitweb.log >/dev/null 2>&1; then false; else true; fi
if grep '^[[]' gitweb.log >/dev/null 2>&1; then
test_debug 'cat gitweb.log >&2' &&
false
else
true
fi

# gitweb.log is left for debugging
# gitweb.output is used to parse HTTP output
Expand Down
7 changes: 6 additions & 1 deletion t/t7500-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ Tests for selected commit options.'
. ./test-lib.sh

commit_msg_is () {
test "`git log --pretty=format:%s%b -1`" = "$1"
expect=commit_msg_is.expect
actual=commit_msg_is.actual

printf "%s" "$(git log --pretty=format:%s%b -1)" >$expect &&
printf "%s" "$1" >$actual &&
test_cmp $expect $actual
}

# A sanity check to see if commit is working at all.
Expand Down
Loading

0 comments on commit a66cee2

Please sign in to comment.