ohloh_scm 3.0.13 → 3.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -6
- data/lib/ohloh_scm/git/scm.rb +1 -1
- data/lib/ohloh_scm/version.rb +1 -1
- data/spec/ohloh_scm/git/scm_spec.rb +21 -0
- 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: bbd14da8a1153f983dd2e092eae7ea3a032e368dbcdc74231b02fe144cd41c21
|
4
|
+
data.tar.gz: c417dbf9528efdf04df184eb5ace45f25f95ccef8fe5090b9bace379ce2cffc2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5996521cf024e5916ef08d08918c96e84962da90d4b6938fe184c0df7ea6663349dd93d6031bb4743febb9c05d4ba70f95fcdee976c57d6b3a9d785fcf2f903b
|
7
|
+
data.tar.gz: efa53ddd6be82af4a9f173b7b3c196da3d52ea74b9f662394ef9279f1cb85c91dd288654f0e075dcef43230d9314a030b1aef79d54f25a4801107b746b1a39f6
|
data/README.md
CHANGED
@@ -20,17 +20,13 @@ One may use Docker to run Ohloh SCM and test changes.
|
|
20
20
|
```sh
|
21
21
|
$ git clone https://github.com/blackducksoftware/ohloh_scm
|
22
22
|
$ cd ohloh_scm
|
23
|
-
$
|
23
|
+
$ docker build -t ohloh_scm:foobar .
|
24
24
|
|
25
25
|
# To run all tests, we need to start the ssh server and set UTF-8 locale for encoding tests.
|
26
26
|
$ cmd='/etc/init.d/ssh start; LANG=en_US.UTF-8 rake test 2> /dev/null'
|
27
|
-
$ docker run -P -v $(pwd):/home/app/ohloh_scm -ti
|
27
|
+
$ docker run --rm -P -v $(pwd):/home/app/ohloh_scm -ti ohloh_scm:foobar /bin/sh -c "$cmd"
|
28
28
|
# This mounts the current folder into the docker container;
|
29
29
|
# hence any edits made in ohloh_scm on the host machine would reflect in the container.
|
30
|
-
|
31
|
-
# One may also edit the Dockerfile & build the image locally for other distros.
|
32
|
-
$ docker build -t ohloh_scm:custom .
|
33
|
-
$ docker run -P -v $(pwd):/home/app/ohloh_scm -ti ohloh_scm:custom /bin/bash
|
34
30
|
```
|
35
31
|
|
36
32
|
## Development Setup
|
data/lib/ohloh_scm/git/scm.rb
CHANGED
@@ -66,7 +66,7 @@ module OhlohScm
|
|
66
66
|
return if branch_name.to_s.empty?
|
67
67
|
return if activity.branches.include?(branch_name)
|
68
68
|
|
69
|
-
run "cd '#{url}' && git branch -f #{branch_name} origin/#{branch_name}"
|
69
|
+
run "cd '#{url}' && git remote update && git branch -f #{branch_name} origin/#{branch_name}"
|
70
70
|
end
|
71
71
|
|
72
72
|
# Deletes everything but the *.git* folder in the working directory.
|
data/lib/ohloh_scm/version.rb
CHANGED
@@ -33,6 +33,27 @@ describe 'Git::Scm' do
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
+
it 'must update branches in local copy' do
|
37
|
+
test_branch_name = 'test' # consider that 'test' is the current *main* branch.
|
38
|
+
|
39
|
+
with_git_repository('git_with_multiple_branch', test_branch_name) do |src_core|
|
40
|
+
tmpdir do |dest_dir|
|
41
|
+
core = OhlohScm::Factory.get_core(scm_type: :git, url: dest_dir, branch_name: test_branch_name)
|
42
|
+
core.scm.pull(src_core.scm, TestCallback.new)
|
43
|
+
|
44
|
+
# Emulate a scenario where the local copy doesn't have the current *main* branch.
|
45
|
+
`cd #{dest_dir} && git checkout master && git branch -D test`
|
46
|
+
|
47
|
+
local_branch_cmd = "cd #{dest_dir} && git branch | grep '\*' | sed 's/^\* //'"
|
48
|
+
`#{ local_branch_cmd }`.chomp.must_equal 'master'
|
49
|
+
|
50
|
+
# On doing a refetch, our local copy will now have the updated *main* branch.
|
51
|
+
core.scm.pull(src_core.scm, TestCallback.new)
|
52
|
+
`#{ local_branch_cmd }`.chomp.must_equal test_branch_name
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
36
57
|
it 'must test the basic conversion to git' do
|
37
58
|
with_cvs_repository('cvs', 'simple') do |src_core|
|
38
59
|
tmpdir do |dest_dir|
|
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.14
|
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: 2021-
|
11
|
+
date: 2021-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |-
|
14
14
|
The OpenHub source control management library for \
|