Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't crash when run on a directory that isn't a git directory
  • Loading branch information
jmaslak committed Aug 3, 2015
1 parent 106d772 commit 76996e1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/Test/Continuous.pm
Expand Up @@ -103,9 +103,12 @@ sub _get_exclude_list {

# Attempt to get the git directory Test::Continuous was run in
my $path = getcwd;
my $git_repo_top_level = Git::Repository->run( 'rev-parse', '--show-toplevel', {
cwd => $path,
});
my $git_repo_top_level;
eval {
$git_repo_top_level = Git::Repository->run( 'rev-parse', '--show-toplevel', {
cwd => $path,
});
};
my ( $git_ignore, $git_dir );

# If the git command came up with a git repo use it's .gitignore
Expand Down Expand Up @@ -150,7 +153,7 @@ sub _run_once {
my @command_args = ( @prove_args, @tests, '::', @classes );

_cls();
print "prove --norc " . join(" ", @command_args) . "\n";
print "prove --norc -v -m " . join(" ", @command_args) . "\n";

# This is from the prove source code
my $script = <<'EOS';
Expand Down

0 comments on commit 76996e1

Please sign in to comment.