summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c2e357c)
raw | patch | inline | side by side (parent: c2e357c)
author | Frank Lichtenheld <frank@lichtenheld.de> | |
Fri, 14 Mar 2008 17:29:29 +0000 (18:29 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 15 Mar 2008 08:43:56 +0000 (01:43 -0700) |
git var doesn't require to be called in a repository anymore,
so don't require it either.
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
so don't require it either.
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
perl/Git.pm | patch | blob | history |
diff --git a/perl/Git.pm b/perl/Git.pm
index 67b3749f0e80e2ea74b71acba43fa69b92a9cc40..2e7f896baec00d644903af5d967b6c781ee3503a 100644 (file)
--- a/perl/Git.pm
+++ b/perl/Git.pm
"$name <$email>" eq ident_person($name);
$time_tz =~ /^\d+ [+-]\d{4}$/;
-Both methods must be called on a repository instance.
-
=cut
sub ident {
- my ($self, $type) = @_;
+ my ($self, $type) = _maybe_self(@_);
my $identstr;
if (lc $type eq lc 'committer' or lc $type eq lc 'author') {
- $identstr = $self->command_oneline('var', 'GIT_'.uc($type).'_IDENT');
+ my @cmd = ('var', 'GIT_'.uc($type).'_IDENT');
+ unshift @cmd, $self if $self;
+ $identstr = command_oneline(@cmd);
} else {
$identstr = $type;
}
}
sub ident_person {
- my ($self, @ident) = @_;
- $#ident == 0 and @ident = $self->ident($ident[0]);
+ my ($self, @ident) = _maybe_self(@_);
+ $#ident == 0 and @ident = $self ? $self->ident($ident[0]) : ident($ident[0]);
return "$ident[0] <$ident[1]>";
}