summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4a6b9bb)
raw | patch | inline | side by side (parent: 4a6b9bb)
author | Theodore Ts'o <tytso@mit.edu> | |
Tue, 20 Feb 2007 20:13:42 +0000 (15:13 -0500) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 21 Feb 2007 07:58:37 +0000 (23:58 -0800) |
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
perl/Git.pm | patch | blob | history |
diff --git a/perl/Git.pm b/perl/Git.pm
index f2c156cde9c1ae62af12d2c213ac8b3a2cc71f21..b5b1cf5edcd860e88c461c600d3fa841654fef76 100644 (file)
--- a/perl/Git.pm
+++ b/perl/Git.pm
}
+=item config_boolean ( VARIABLE )
+
+Retrieve the boolean configuration C<VARIABLE>.
+
+Must be called on a repository instance.
+
+This currently wraps command('config') so it is not so fast.
+
+=cut
+
+sub config_boolean {
+ my ($self, $var) = @_;
+ $self->repo_path()
+ or throw Error::Simple("not a repository");
+
+ try {
+ return $self->command_oneline('config', '--bool', '--get',
+ $var);
+ } catch Git::Error::Command with {
+ my $E = shift;
+ if ($E->value() == 1) {
+ # Key not found.
+ return undef;
+ } else {
+ throw $E;
+ }
+ };
+}
+
+
=item ident ( TYPE | IDENTSTR )
=item ident_person ( TYPE | IDENTSTR | IDENTARRAY )