Skip to content

Commit 242d172

Browse files
author
kselvraj
committed
Retain multiple branches for git repository
1 parent eb6c568 commit 242d172

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/ohloh_scm/git/scm.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ def fetch_new_commits(remote_scm)
4343
end
4444

4545
def clone_and_create_tracking_branch(remote_scm)
46-
run "rm -rf '#{url}'"
47-
run "git clone -q -n '#{remote_scm.url}' '#{url}'"
46+
unless status.scm_dir_exist?
47+
run "rm -rf '#{url}'"
48+
run "git clone -q -n '#{remote_scm.url}' '#{url}'"
49+
end
4850
create_tracking_branch(remote_scm.branch_name) # ensure the correct branch exists locally
4951
clean_and_checkout_branch # switch to the correct branch
5052
end

lib/ohloh_scm/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
module OhlohScm
44
module Version
5-
STRING = '3.0.2'
5+
STRING = '3.0.3'
66
GIT = '2.17.1'
77
SVN = '1.9.7'
88
CVSNT = '2.5.04'

0 commit comments

Comments
 (0)