dco 1.0.0 → 1.0.1
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/CHANGELOG.md +5 -0
- data/lib/dco/cli.rb +11 -10
- data/lib/dco/version.rb +1 -1
- data/spec/sign_spec.rb +19 -0
- 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: f839540539866426b2c722e80c2a72c907a9cb38
|
4
|
+
data.tar.gz: c8f73facb60d4e5c0afc3ecdbf3032e99aa35b4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f77eb6ce065e377e3a426d2561894d7c683fff67589f31f83d80d08a3451280e905d0d8bc4ec08cbc8f36efc0be003166ad037a94a184e86791ae128397d0c3e
|
7
|
+
data.tar.gz: a00efa56e1b0447ec1f75c6113fe2691d89740fcd0e13da05a23995cce43e543536bf377869852f3efd3e17bbf737e26ace767ff63ba037453adad2c88a6daa5
|
data/CHANGELOG.md
CHANGED
data/lib/dco/cli.rb
CHANGED
@@ -196,16 +196,17 @@ EOH
|
|
196
196
|
end
|
197
197
|
|
198
198
|
# First check for a stored ref under refs/original/.
|
199
|
-
|
200
|
-
|
201
|
-
#
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
199
|
+
backup_refs = Dir[File.join(repo.repo.path, 'refs/original/refs/heads/*')]
|
200
|
+
backup_refs_label = if backup_refs.size > 1
|
201
|
+
"branches #{backup_refs.map {|p| File.basename(p) }.join(', ')} are"
|
202
|
+
else
|
203
|
+
"branch #{backup_refs.first} is"
|
204
|
+
end
|
205
|
+
unless backup_refs.empty? || confirm?("An existing backup of #{backup_refs_label} present from a previous filter-branch. Do you want to remove this backup and continue? [yes/no]")
|
206
|
+
raise Thor::Error.new('Backup ref present, not continuing')
|
207
|
+
end
|
208
|
+
backup_refs.each do |ref|
|
209
|
+
File.unlink(ref)
|
209
210
|
end
|
210
211
|
|
211
212
|
# Next examine all the commits we will be touching.
|
data/lib/dco/version.rb
CHANGED
data/spec/sign_spec.rb
CHANGED
@@ -201,6 +201,25 @@ describe 'dco sign' do
|
|
201
201
|
end
|
202
202
|
end # /context with an existing backup pointer
|
203
203
|
|
204
|
+
context 'with an existing backup pointer from a different branch' do
|
205
|
+
before do
|
206
|
+
command 'echo three > testing && git commit -a -m "first branch commit"'
|
207
|
+
dco_command 'sign -y mybranch'
|
208
|
+
command 'git checkout -b mybranch2 && echo four > testing && git commit -a -m "second branch commit"'
|
209
|
+
end
|
210
|
+
dco_command 'sign -y mybranch2'
|
211
|
+
|
212
|
+
it do
|
213
|
+
expect(subject.exitstatus).to eq 0
|
214
|
+
expect(subject.stdout).to match /^Developer's Certificate of Origin 1\.1$/
|
215
|
+
expect(subject.stdout).to match /^Going to sign-off the following commits:\n\* \h{7} Alan Smithee <asmithee@example\.com> second branch commit$/
|
216
|
+
expect(repo.log[0].message).to eq "second branch commit\n\nSigned-off-by: Alan Smithee <asmithee@example.com>"
|
217
|
+
expect(repo.log[1].message).to eq "first branch commit\n\nSigned-off-by: Alan Smithee <asmithee@example.com>"
|
218
|
+
expect(repo.log[2].message).to eq "second commit"
|
219
|
+
expect(repo.log[3].message).to eq "first commit"
|
220
|
+
end
|
221
|
+
end # /context with an existing backup pointer from a different branch
|
222
|
+
|
204
223
|
context 'with an existing backup pointer without -y' do
|
205
224
|
before do
|
206
225
|
command 'echo three > testing && git commit -a -m "first branch commit"'
|