lib/learn_test/git/wip/branch.rb in learn-test-3.3.0.pre.4 vs lib/learn_test/git/wip/branch.rb in learn-test-3.3.0.pre.5

- old
+ new

@@ -14,14 +14,16 @@ def last_revision(raise_no_commits: false) @last_revision ||= begin begin @base.revparse(@name) rescue ::Git::GitExecuteError => e + regex = LearnTest::Git::Wip::NoCommitsError::REGEX + if raise_no_commits - raise e.message.match(NoCommitsError::REGEX) ? NoCommitsError.new(@name) : e + raise e.message.match(regex) ? LearnTest::Git::Wip::NoCommitsError.new(@name) : e end - raise unless e.message.match(NoCommitsError::REGEX) + raise unless e.message.match(regex) false end end end