Class: FlashFlow::BranchMerger
- Inherits:
-
Object
- Object
- FlashFlow::BranchMerger
- Defined in:
- lib/flash_flow/branch_merger.rb
Instance Attribute Summary collapse
-
#conflict_sha ⇒ Object
readonly
Returns the value of attribute conflict_sha.
-
#resolutions ⇒ Object
readonly
Returns the value of attribute resolutions.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
- #do_merge(rerere_forget) ⇒ Object
-
#initialize(git, branch) ⇒ BranchMerger
constructor
A new instance of BranchMerger.
- #sha ⇒ Object
Constructor Details
#initialize(git, branch) ⇒ BranchMerger
Returns a new instance of BranchMerger.
6 7 8 9 |
# File 'lib/flash_flow/branch_merger.rb', line 6 def initialize(git, branch) @git = git @branch = branch end |
Instance Attribute Details
#conflict_sha ⇒ Object (readonly)
Returns the value of attribute conflict_sha.
4 5 6 |
# File 'lib/flash_flow/branch_merger.rb', line 4 def conflict_sha @conflict_sha end |
#resolutions ⇒ Object (readonly)
Returns the value of attribute resolutions.
4 5 6 |
# File 'lib/flash_flow/branch_merger.rb', line 4 def resolutions @resolutions end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
4 5 6 |
# File 'lib/flash_flow/branch_merger.rb', line 4 def result @result end |
Instance Method Details
#do_merge(rerere_forget) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/flash_flow/branch_merger.rb', line 11 def do_merge(rerere_forget) if sha.nil? @result = :deleted return end @git.run("merge --no-ff #{@git.remote}/#{@branch.ref}") if @git.last_success? || try_rerere(rerere_forget) @result = :success else @conflict_sha = merge_rollback @result = :conflict end end |
#sha ⇒ Object
27 28 29 30 |
# File 'lib/flash_flow/branch_merger.rb', line 27 def sha @sha if defined?(@sha) @sha = get_sha end |