Class: Dapp::Dimg::GitRepo::Own
- Defined in:
- lib/dapp/dimg/git_repo/own.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#diff(from, to, **kwargs) ⇒ Object
NOTICE: Параметры nil, to: nil можно указать только для Own repo.
- #exclude_paths ⇒ Object
-
#initialize(dimg) ⇒ Own
constructor
A new instance of Own.
- #latest_commit(_branch = nil) ⇒ Object
- #lookup_commit(commit) ⇒ Object
- #path ⇒ Object
Methods inherited from Base
#branch, #commit_at, #commit_exists?, #find_commit_id_by_message, #lookup_object, #patches, #walker
Constructor Details
#initialize(dimg) ⇒ Own
Returns a new instance of Own.
5 6 7 |
# File 'lib/dapp/dimg/git_repo/own.rb', line 5 def initialize(dimg) super(dimg, 'own') end |
Instance Method Details
#diff(from, to, **kwargs) ⇒ Object
NOTICE: Параметры nil, to: nil можно указать только для Own repo. NOTICE: Для Remote repo такой вызов не имеет смысла и это ошибка пользователя класса Remote.
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/dapp/dimg/git_repo/own.rb', line 22 def diff(from, to, **kwargs) if from.nil? and to.nil? mid_commit = latest_commit diff_obj = super(nil, mid_commit, **kwargs) diff_obj.merge! git.lookup(mid_commit).diff_workdir(**kwargs) diff_obj elsif to.nil? git.lookup(from).diff_workdir(**kwargs) else super end end |
#exclude_paths ⇒ Object
9 10 11 |
# File 'lib/dapp/dimg/git_repo/own.rb', line 9 def exclude_paths dimg.dapp.local_git_artifact_exclude_paths end |
#latest_commit(_branch = nil) ⇒ Object
35 36 37 |
# File 'lib/dapp/dimg/git_repo/own.rb', line 35 def latest_commit(_branch = nil) git.head.target_id end |