git_commands 3.2.9 → 3.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cc41c685ee29b19f620cbf0048aabc586edd6afe
4
- data.tar.gz: b0f79689c6acfff02ba0063949758c9882b56047
3
+ metadata.gz: 4794d0456217191d8939a0bf9c547221176e6ecb
4
+ data.tar.gz: ddb26bbffe05ef5ec8f997f889aded4fee03201b
5
5
  SHA512:
6
- metadata.gz: 68a1bfc9f4ebd26648c29150a8d12a019cee51338d39e05de19bdae3202bdd74ea549595b644d710ed9ffef5655bacacc9dbba0003e6a66e24f08eb0d232d812
7
- data.tar.gz: d6328e5ff3d553be85d27572e62160b7bafbd727af9e01f0ec45ead34e6415aaf076359ed290da75dc5d8620f874c325d595bc923d0163375657a375b523beb3
6
+ metadata.gz: b6d7669adc0eacc64866b606b5f1aa7a437708ed4f7ddb78a15d13a46bbabfddda4d7c75869bbaa47f1f378c8ab66ed336ffa798d59b32b970fd60010b26a545
7
+ data.tar.gz: e850c3d49d5ed95020bfc5bebaff07ef91aabb968c88d615cd76f7421c89cb51b7dd28e6cca61e731a08288e8e4a02ed112bf0b24a87f8cfb48e5ba5422121a8
@@ -42,7 +42,7 @@ module GitCommands
42
42
  warning("Rebasing branch: #{branch}")
43
43
  `git checkout #{branch}`
44
44
  `git pull origin #{branch}`
45
- next unless rebase_with_master
45
+ next unless rebase_with
46
46
  `git push -f origin #{branch}`
47
47
  success("Rebased successfully!")
48
48
  end
@@ -60,8 +60,8 @@ module GitCommands
60
60
  @branches.each do |branch|
61
61
  warning("Merging branch: #{branch}")
62
62
  `git checkout -b #{temp} origin/#{branch} --no-track`
63
- remove_locals([temp, release]) && exit unless rebase_with_master
64
- `git rebase #{release}`
63
+ clean_and_exit([temp, release]) unless rebase_with
64
+ clean_and_exit([temp]) unless rebase_with(release)
65
65
  `git checkout #{release}`
66
66
  `git merge #{temp}`
67
67
  `git branch -D #{temp}`
@@ -91,6 +91,13 @@ module GitCommands
91
91
  error("Got conflicts, aborting rebase!")
92
92
  end
93
93
 
94
+ private def rebase_with(branch = "#{Branch::ORIGIN}#{Branch::MASTER}")
95
+ `git rebase #{branch}`
96
+ return true unless @repo.locked?
97
+ @repo.unlock
98
+ error("Got conflicts, aborting rebase with #{branch}!")
99
+ end
100
+
94
101
  private def enter_repo
95
102
  Dir.chdir(@repo) do
96
103
  pull_master
@@ -104,5 +111,10 @@ module GitCommands
104
111
  `git branch -D #{branch}`
105
112
  end
106
113
  end
114
+
115
+ private def clean_and_exit(branches)
116
+ remove_locals(branches)
117
+ exit
118
+ end
107
119
  end
108
120
  end
@@ -1,3 +1,3 @@
1
1
  module GitCommands
2
- VERSION = "3.2.9"
2
+ VERSION = "3.3.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_commands
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.9
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - costajob