Module: GitCli::Push
- Included in:
- Gvcs::Workspace
- Defined in:
- lib/git_cli/push.rb
Instance Method Summary collapse
- #push_changes(repos, branch = "master") ⇒ Object (also: #push)
- #push_changes_with_tags(repos, branch = "master") ⇒ Object (also: #push_with_tags, #push_with_tag, #push_changes_with_tag)
Instance Method Details
#push_changes(repos, branch = "master") ⇒ Object Also known as: push
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/git_cli/push.rb', line 22 def push_changes(repos, branch = "master") check_vcs #check_repos raise_if_empty(repos, "Push to repository name cannot be empty", GitCliException) raise_if_false(is_repos_exist?(repos), "Given repository name '#{repos}' is not configured for this workspace", GitCliException) cmd = [] cmd << "cd" cmd << @wsPath cmd << "&&" cmd << @vcs.exe_path cmd << "push" cmd << repos cmd << branch cmdln = cmd.join " " log_debug "Push : #{cmdln}" os_exec(cmdln) do |st, res| [st.success?, res.strip] end end |
#push_changes_with_tags(repos, branch = "master") ⇒ Object Also known as: , push_with_tag, push_changes_with_tag
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/git_cli/push.rb', line 47 def (repos, branch = "master") check_vcs #check_repos raise_if_empty(repos, "Push to repository name cannot be empty", GitCliException) raise_if_false(is_repos_exist?(repos), "Given repository name '#{repos}' is not configured for this workspace", GitCliException) cmd = [] cmd << "cd" cmd << @wsPath cmd << "&&" cmd << @vcs.exe_path cmd << "push" cmd << repos cmd << branch cmd << "--tags" cmdln = cmd.join " " log_debug "Push with tags : #{cmdln}" os_exec(cmdln) do |st, res| [st.success?, res.strip] end end |