Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
gitweb: Faster return from git_get_preceding_references if possible
author
Jakub Narebski
<jnareb@gmail.com>
Thu, 24 Aug 2006 17:39:32 +0000
(19:39 +0200)
committer
Junio C Hamano
<junkio@cox.net>
Sat, 26 Aug 2006 02:39:55 +0000
(19:39 -0700)
Return on first ref found when git_get_preceding_references
is called in scalar context
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
gitweb/gitweb.perl
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
470b96d
)
diff --git
a/gitweb/gitweb.perl
b/gitweb/gitweb.perl
index b964302a5aa9a24cedc39bb3ffcabb9bc91b6f50..01452d2c747bb29540d512ece6887c91b2ef040e 100755
(executable)
--- a/
gitweb/gitweb.perl
+++ b/
gitweb/gitweb.perl
@@
-789,16
+789,15
@@
sub git_get_preceding_references {
or return undef;
my @reflist;
- my $firstref;
foreach my $commit (@commits) {
foreach my $ref (@{$refs->{$commit}}) {
-
$firstref = $ref unless $firstref
;
+
return $ref unless wantarray
;
push @reflist, $ref;
}
}
- return
wantarray ? @reflist : $firstref
;
+ return
@reflist
;
}
## ----------------------------------------------------------------------