ohloh_scm 3.0.5 → 3.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ohloh_scm/git/scm.rb +7 -3
- data/lib/ohloh_scm/version.rb +1 -1
- data/spec/ohloh_scm/git/scm_spec.rb +0 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a355a0742b48e9e0205d3bd3c4ffb6dee5e2eafcbadf6f38104455a807f2142f
|
4
|
+
data.tar.gz: a33e29534f3587b6434f496d702aefae3ea203747890402380cb7ecdd7fc4ad0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3c17e75d2c59625f815d5b8b59a490b815dfcc1ec7d1031ee95040340a7b67d0be67b1b4012fc1953cd8705ea2c9289710986caacf21c6bc788800af882d8fe
|
7
|
+
data.tar.gz: 5d3db3fd91b90b1491b3144eee0936121394ce7e61f9f83fcc216eee3dc1a08414ba86315f3bd52a96a21d43677717cb813142aa9150e6d98ceafe967658be33
|
data/lib/ohloh_scm/git/scm.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module OhlohScm
|
4
4
|
module Git
|
5
|
-
class Scm < OhlohScm::Scm
|
5
|
+
class Scm < OhlohScm::Scm # rubocop:disable Metrics/ClassLength
|
6
6
|
def initialize(core:, url:, branch_name:, username:, password:)
|
7
7
|
super
|
8
8
|
@branch_name = branch_name || 'master'
|
@@ -54,14 +54,18 @@ module OhlohScm
|
|
54
54
|
# We need very high reliability and this sequence gets the job done every time.
|
55
55
|
def clean_and_checkout_branch
|
56
56
|
return unless status.scm_dir_exist?
|
57
|
-
|
58
|
-
run "cd '#{url}' && git clean -f -d -x"
|
59
57
|
return unless status.branch?(branch_name)
|
60
58
|
|
59
|
+
run "cd '#{url}' && git clean -f -d -x"
|
60
|
+
clean_git_lock_file
|
61
61
|
run "cd '#{url}' && git reset --hard HEAD"
|
62
62
|
run "cd '#{url}' && git checkout #{branch_name} --"
|
63
63
|
end
|
64
64
|
|
65
|
+
def clean_git_lock_file
|
66
|
+
run "rm #{url}/.git/index.lock" if File.exist?("#{url}/.git/index.lock")
|
67
|
+
end
|
68
|
+
|
65
69
|
def create_tracking_branch(branch_name)
|
66
70
|
return if branch_name.to_s.empty?
|
67
71
|
return if activity.branches.include?(branch_name)
|
data/lib/ohloh_scm/version.rb
CHANGED
@@ -27,7 +27,6 @@ describe 'Git::Scm' do
|
|
27
27
|
remote_master_branch_sha = `cd #{dest_dir} && git rev-parse origin/master`
|
28
28
|
master_branch_sha = `cd #{dest_dir} && git rev-parse master`
|
29
29
|
test_branch_sha = `cd #{dest_dir} && git rev-parse test`
|
30
|
-
byebug
|
31
30
|
|
32
31
|
master_branch_sha.wont_equal test_branch_sha
|
33
32
|
master_branch_sha.must_equal remote_master_branch_sha
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ohloh_scm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenHub Team at Synopsys
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |-
|
14
14
|
The OpenHub source control management library for \
|