Skip to content

Commit 0f3fcc2

Browse files
committed
OTWO-5773: Revert changes for unresolved issues
This reverts 5cbb665 & 63a170b. These issues are unresolved. It is probable that the changes made to fix the first issue lead to the later issue.
1 parent bb099ab commit 0f3fcc2

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

lib/ohloh_scm/git/scm.rb

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
module OhlohScm
44
module Git
5-
class Scm < OhlohScm::Scm # rubocop:disable Metrics/ClassLength
5+
class Scm < OhlohScm::Scm
66
def initialize(core:, url:, branch_name:, username:, password:)
77
super
88
@branch_name = branch_name || 'master'
@@ -54,16 +54,12 @@ def clone_and_create_tracking_branch(remote_scm)
5454
# We need very high reliability and this sequence gets the job done every time.
5555
def clean_and_checkout_branch
5656
return unless status.scm_dir_exist?
57-
return unless status.branch?(branch_name)
5857

5958
run "cd '#{url}' && git clean -f -d -x"
60-
clean_git_lock_file
61-
run "cd '#{url}' && git reset --hard HEAD"
62-
run "cd '#{url}' && git checkout #{branch_name} --"
63-
end
59+
return unless status.branch?(branch_name)
6460

65-
def clean_git_lock_file
66-
run "rm #{url}/.git/index.lock" if File.exist?("#{url}/.git/index.lock")
61+
run "cd '#{url}' && git checkout #{branch_name} --"
62+
run "cd '#{url}' && git reset --hard heads/#{branch_name} --"
6763
end
6864

6965
def create_tracking_branch(branch_name)

0 commit comments

Comments
 (0)