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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b11f981c7254d3f740cc89cf98c8214622f5eb971a191a71fb8eea4c01b5c434
4
- data.tar.gz: 10729adb8d48eb1e19daaba54f70bf8f13679f023875b9d001d12f470f5cee99
3
+ metadata.gz: a355a0742b48e9e0205d3bd3c4ffb6dee5e2eafcbadf6f38104455a807f2142f
4
+ data.tar.gz: a33e29534f3587b6434f496d702aefae3ea203747890402380cb7ecdd7fc4ad0
5
5
  SHA512:
6
- metadata.gz: fcbac1368d1c58e7aa8a18473c1893d5438025c31e7caff8da4621b63c3f02272d5ac3742a4851ed89aa199351cfb4390638aa0387639030a1002417dd39c6da
7
- data.tar.gz: 1cbc4944d0b7345d5613f4a1f9d4bfd61287513f87d808bc2a03eef901d902dcdddcc8ae8103db60b7236e8760af307e0bf8de8b4dbb2435668ff032e6b2fbf6
6
+ metadata.gz: b3c17e75d2c59625f815d5b8b59a490b815dfcc1ec7d1031ee95040340a7b67d0be67b1b4012fc1953cd8705ea2c9289710986caacf21c6bc788800af882d8fe
7
+ data.tar.gz: 5d3db3fd91b90b1491b3144eee0936121394ce7e61f9f83fcc216eee3dc1a08414ba86315f3bd52a96a21d43677717cb813142aa9150e6d98ceafe967658be33
@@ -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)
@@ -2,7 +2,7 @@
2
2
 
3
3
  module OhlohScm
4
4
  module Version
5
- STRING = '3.0.5'
5
+ STRING = '3.0.6'
6
6
  GIT = '2.17.1'
7
7
  SVN = '1.9.7'
8
8
  CVSNT = '2.5.04'
@@ -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.5
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-13 00:00:00.000000000 Z
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 \