+ 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;