Skip to content

Commit a66cee2

Browse files
committed
Merge branch 'maint'
* 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
2 parents 5673d69 + d5a719e commit a66cee2

5 files changed

Lines changed: 15 additions & 92 deletions

File tree

gitweb/gitweb.perl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3501,7 +3501,7 @@ sub print_feed_meta {
35013501
$href_params{'-title'} = 'log';
35023502
}
35033503

3504-
foreach my $format qw(RSS Atom) {
3504+
foreach my $format (qw(RSS Atom)) {
35053505
my $type = lc($format);
35063506
my %link_attr = (
35073507
'-rel' => 'alternate',
@@ -3682,7 +3682,7 @@ sub git_footer_html {
36823682
}
36833683
$href_params{'-title'} ||= 'log';
36843684

3685-
foreach my $format qw(RSS Atom) {
3685+
foreach my $format (qw(RSS Atom)) {
36863686
$href_params{'action'} = lc($format);
36873687
print $cgi->a({-href => href(%href_params),
36883688
-title => "$href_params{'-title'} $format feed",
@@ -4412,7 +4412,7 @@ sub git_difftree_body {
44124412
}
44134413
if ($diff->{'from_mode'} ne ('0' x 6)) {
44144414
$from_mode_oct = oct $diff->{'from_mode'};
4415-
if (S_ISREG($to_mode_oct)) { # only for regular file
4415+
if (S_ISREG($from_mode_oct)) { # only for regular file
44164416
$from_mode_str = sprintf("%04o", $from_mode_oct & 0777); # permission bits
44174417
}
44184418
$from_file_type = file_type($diff->{'from_mode'});

t/gitweb-lib.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,12 @@ gitweb_run () {
8282
}
8383
close O;
8484
' gitweb.output &&
85-
if grep '^[[]' gitweb.log >/dev/null 2>&1; then false; else true; fi
85+
if grep '^[[]' gitweb.log >/dev/null 2>&1; then
86+
test_debug 'cat gitweb.log >&2' &&
87+
false
88+
else
89+
true
90+
fi
8691

8792
# gitweb.log is left for debugging
8893
# gitweb.output is used to parse HTTP output

t/t7500-commit.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ Tests for selected commit options.'
1010
. ./test-lib.sh
1111

1212
commit_msg_is () {
13-
test "`git log --pretty=format:%s%b -1`" = "$1"
13+
expect=commit_msg_is.expect
14+
actual=commit_msg_is.actual
15+
16+
printf "%s" "$(git log --pretty=format:%s%b -1)" >$expect &&
17+
printf "%s" "$1" >$actual &&
18+
test_cmp $expect $actual
1419
}
1520

1621
# A sanity check to see if commit is working at all.

0 commit comments

Comments
 (0)