git_commands 3.2.1 → 3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/git_commands/command.rb +14 -6
- data/lib/git_commands/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13ca5fec82febdad4d82a8646490fea282ee1580
|
4
|
+
data.tar.gz: f42e6593a54309fa6efa2fb0e779f179b6600492
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b22a5ab76a7338167a5ad00b9f8e4d1e0e036626f12e9400b47f9f0d531d532a68a01ad3edd102bd280cb91800b5fcb95a407a1f4b2bf69d066a12b6d0316be
|
7
|
+
data.tar.gz: 9233e1627bbbb488cddb1452fba6948895f8603918b5e07cff258f3bad855df1cfe7de9f99c8447618e97964a6e8279ecc42cc87142d059eb4b3b3b0f047e500
|
data/lib/git_commands/command.rb
CHANGED
@@ -16,6 +16,7 @@ module GitCommands
|
|
16
16
|
def initialize(repo:, branches:, repo_klass: Repository, branch_klass: Branch, out: STDOUT)
|
17
17
|
@out = out
|
18
18
|
@repo = repo_klass.new(repo)
|
19
|
+
@conflictual = []
|
19
20
|
Dir.chdir(@repo) do
|
20
21
|
@branches = branch_klass.factory(branches)
|
21
22
|
@timestamp = Time.new.strftime("%Y-%m-%d")
|
@@ -44,12 +45,13 @@ module GitCommands
|
|
44
45
|
warning("Rebasing branch: #{branch}")
|
45
46
|
`git checkout #{branch}`
|
46
47
|
`git pull origin #{branch}`
|
47
|
-
next unless rebase_with_master
|
48
|
+
@conflictual << branch && next unless rebase_with_master
|
48
49
|
`git push -f origin #{branch}`
|
49
50
|
`git checkout #{Branch::MASTER}`
|
50
51
|
`git branch -D #{branch}`
|
51
52
|
success "Rebased successfully!"
|
52
53
|
end
|
54
|
+
delete_conflictual
|
53
55
|
end
|
54
56
|
end
|
55
57
|
end
|
@@ -63,7 +65,7 @@ module GitCommands
|
|
63
65
|
@branches.each do |branch|
|
64
66
|
warning("Merging branch: #{branch}")
|
65
67
|
`git checkout -b #{temp} origin/#{branch} --no-track`
|
66
|
-
next unless rebase_with_master
|
68
|
+
@conflictual << branch && next unless rebase_with_master
|
67
69
|
`git rebase #{aggregate}`
|
68
70
|
`git checkout #{aggregate}`
|
69
71
|
`git merge #{temp}`
|
@@ -71,6 +73,7 @@ module GitCommands
|
|
71
73
|
end
|
72
74
|
`git checkout #{Branch::MASTER}`
|
73
75
|
end
|
76
|
+
delete_conflictual
|
74
77
|
success "#{aggregate} branch created"
|
75
78
|
end
|
76
79
|
end
|
@@ -88,13 +91,18 @@ module GitCommands
|
|
88
91
|
`git pull`
|
89
92
|
end
|
90
93
|
|
91
|
-
private def rebase_with_master
|
94
|
+
private def rebase_with_master
|
92
95
|
`git rebase origin/#{Branch::MASTER}`
|
93
96
|
return true unless @repo.locked?
|
94
97
|
`git rebase --abort`
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
+
error("Got conflicts, aborting rebase!")
|
99
|
+
end
|
100
|
+
|
101
|
+
private def delete_conflictual
|
102
|
+
return if @conflictual.empty?
|
103
|
+
@conflictual.each do |branch|
|
104
|
+
`git branch -D #{branch}`
|
105
|
+
end
|
98
106
|
end
|
99
107
|
|
100
108
|
private def enter_repo
|
data/lib/git_commands/version.rb
CHANGED