Module: Avm::Git::Issue::Complete::Push
- Defined in:
- lib/avm/git/issue/complete/push.rb
Instance Method Summary collapse
- #dry_push_args ⇒ Object
- #dry_push_result ⇒ Object
- #master_push ⇒ Object
- #push ⇒ Object
- #pushs_uncached ⇒ Object
- #remove_branch_push ⇒ Object
- #tag_push ⇒ Object
Instance Method Details
#dry_push_args ⇒ Object
8 9 10 |
# File 'lib/avm/git/issue/complete/push.rb', line 8 def dry_push_args %w[push --dry-run] + [remote_name] + pushs end |
#dry_push_result ⇒ Object
12 13 14 15 16 |
# File 'lib/avm/git/issue/complete/push.rb', line 12 def dry_push_result return ::Avm::Result.error('Nothing to push') if pushs.empty? dry_push_execution_result end |
#master_push ⇒ Object
31 32 33 |
# File 'lib/avm/git/issue/complete/push.rb', line 31 def master_push remote_master_hash == branch_hash ? nil : "#{branch_hash}:refs/heads/master" end |
#push ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/avm/git/issue/complete/push.rb', line 18 def push if pushs.empty? info 'PUSH: Nada a enviar' else info "PUSH: enviando \"#{pushs}\"..." git_execute(%w[push origin] + pushs) end end |
#pushs_uncached ⇒ Object
27 28 29 |
# File 'lib/avm/git/issue/complete/push.rb', line 27 def pushs_uncached [master_push, remove_branch_push, tag_push].compact end |
#remove_branch_push ⇒ Object
35 36 37 |
# File 'lib/avm/git/issue/complete/push.rb', line 35 def remove_branch_push remote_branch_hash ? ":refs/heads/#{branch.name}" : nil end |
#tag_push ⇒ Object
39 40 41 42 43 |
# File 'lib/avm/git/issue/complete/push.rb', line 39 def tag_push return nil unless !remote_tag_hash || remote_tag_hash != branch_hash "#{branch_hash}:#{tag}" end |