lib/avm/git/scms/git_subtree.rb in avm-git-0.17.0 vs lib/avm/git/scms/git_subtree.rb in avm-git-0.18.0
- old
+ new
@@ -7,19 +7,27 @@
module Avm
module Git
module Scms
class GitSubtree < ::Avm::Git::Scms::GitSubBase
+ # @return [Boolean]
+ def no_other_git_scm?
+ (::Avm::Git::Scms::Provider.new.all - [self.class])
+ .lazy.map { |scm_class| scm_class.new(path) }.none?(&:valid?)
+ end
+
+ # @return [Boolean]
+ def parent_git_scm?
+ ::Avm::Git::Scms::Provider.new.all.any? { |scm_class| parent_scm.is_a?(scm_class) }
+ end
+
def update
# Do nothing
end
+ # @return [Boolean]
def valid?
- return false unless ::Avm::Git::Scms::Provider
- .new.all.any? { |scm_class| parent_scm.is_a?(scm_class) }
-
- (::Avm::Git::Scms::Provider.new.all - [self.class])
- .lazy.map { |scm_class| scm_class.new(path) }.none?(&:valid?)
+ parent_git_scm? && no_other_git_scm?
end
end
end
end
end