+ if (IS_WIN32) {
+ my @acc;
+ for my $c (@candidates) {
+ push @acc, $c, map "$c.$_", qw/exe com bat cmd/;
+ }
+ @candidates = @acc;
+ }
+ for my $c (@candidates) {
+ if (-x $c) {
+ $git = $c;
+ last;
+ }
+ }
+ Carp::confess("Couldn't find a proper git executable") unless defined $git;
+ $git = File::Spec->canonpath(App::Rgit::Utils::abs_path($git));
+
+ my $conf = 'App::Rgit::Config::Default';
+ eval "require $conf; 1" or Carp::confess("Couldn't load $conf: $@");
+
+ my $r = App::Rgit::Repository->new(fake => 1);
+ return unless defined $r;
+
+ bless {
+ root => $root,
+ git => $git,
+ cwd_repo => $r,
+ debug => defined $args{debug} ? int $args{debug} : WARN,
+ }, $conf;
+}
+
+=head2 C<info $msg>
+
+=head2 C<warn $msg>
+
+=head2 C<err $msg>
+
+=head2 C<crit $msg>
+
+Notifies a message C<$msg> of the corresponding level.
+
+=cut
+
+sub _notify {
+ my $self = shift;
+ my $level = shift;
+ if ($self->debug >= $level) {
+ print STDERR @_;
+ return 1;
+ }
+ return 0;