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>
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;
}
## ----------------------------------------------------------------------