diff --git a/lib/release/create.rb b/lib/release/create.rb index 3925cd8..e816bc8 100644 --- a/lib/release/create.rb +++ b/lib/release/create.rb @@ -17,7 +17,7 @@ module Release validate_version_format version validate_current_branch_master - git_pull current_branch + git_fetch_and_merge current_branch validate_version_is_new version diff --git a/lib/release/finish.rb b/lib/release/finish.rb index 0f0eedc..f6f9f6a 100644 --- a/lib/release/finish.rb +++ b/lib/release/finish.rb @@ -16,7 +16,7 @@ module Release validate_current_branch_is_release - git_pull release_branch + git_fetch_and_merge release_branch update_package_json version_from_release_branch(release_branch) @@ -25,7 +25,8 @@ module Release git_push release_branch git_push_tags - git_checkout "master" + git_checkout 'master' + git_fetch_and_merge current_branch git_local_branch_delete release_branch diff --git a/lib/release/join.rb b/lib/release/join.rb index 499338f..482c438 100644 --- a/lib/release/join.rb +++ b/lib/release/join.rb @@ -15,7 +15,7 @@ module Release subcommand, version = *argv validate_current_branch_master - git_pull current_branch + git_fetch_and_merge current_branch git_checkout_track release_branch_from_version(version) end diff --git a/lib/release/leave.rb b/lib/release/leave.rb index cdbd94f..7cda329 100644 --- a/lib/release/leave.rb +++ b/lib/release/leave.rb @@ -14,8 +14,9 @@ module Release def execute validate_current_branch_is_release - git_checkout "master" - + git_checkout 'master' + git_fetch_and_merge current_branch + git_local_branch_trash current_branch end end diff --git a/lib/release/list.rb b/lib/release/list.rb index 0f2740e..2b72678 100644 --- a/lib/release/list.rb +++ b/lib/release/list.rb @@ -13,8 +13,8 @@ module Release def execute validate_current_branch_master - git_pull current_branch - + git_fetch_and_merge current_branch + puts puts show_existing_tags puts diff --git a/lib/release/start.rb b/lib/release/start.rb index 33ec926..468d3d2 100644 --- a/lib/release/start.rb +++ b/lib/release/start.rb @@ -22,7 +22,7 @@ module Release validate_version_format version validate_current_branch_master - git_pull current_branch + git_fetch_and_merge current_branch validate_version_exists version diff --git a/lib/release/trash.rb b/lib/release/trash.rb index 70a9433..aca5c20 100644 --- a/lib/release/trash.rb +++ b/lib/release/trash.rb @@ -25,6 +25,7 @@ module Release validate_current_branch_is_release git_checkout 'master' + git_fetch_and_merge current_branch git_local_branch_trash release_branch diff --git a/lib/shared/runnable.rb b/lib/shared/runnable.rb index d75f84e..c14326a 100644 --- a/lib/shared/runnable.rb +++ b/lib/shared/runnable.rb @@ -48,6 +48,19 @@ module Shared run_cmd "git checkout #{branch}" end + def git_fetch + run_cmd "git fetch origin && git fetch origin --tags" + end + + def git_remote_merge ( branch ) + run_cmd "git merge origin/#{branch}" + end + + def git_fetch_and_merge (branch) + git_fetch + git_remote_merge branch + end + def git_remote_branch_delete ( branch ) run_cmd "git push origin :#{branch}" end