ohloh_scm 3.0.17 → 3.0.19

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: 376633ab1bce231fd0d3dbcb685a6270c6f90b41bb99f2e4062965a2011476b4
4
- data.tar.gz: 159827abd46fd1f87d7c85cb226ea410071ba6d8a6e73c2db0a598c2f44d1465
3
+ metadata.gz: 9617a76fcacb0cbb50e36d0008042ed686372e29f0e101ca62d52ab7cf1e853a
4
+ data.tar.gz: 1c11aa29232ba00d508329f3c24c773d5e7ffa0b02fac7fff0a060d0476ec5c6
5
5
  SHA512:
6
- metadata.gz: 520a3bc2a9c827959f715ad2febf37df9f63ef9f817743c0b9e82d69f486632b2cbf7b72d89c604848b1680d5ab37aa15f8b58c3408da0b90960f504a14d451a
7
- data.tar.gz: a346e6eb4db5eb8e69ed3e8dbe66043c3a69350bfc8760abffbbd8202b9bb8f4e58099a8ae6279adec67a4d897be3052e822838c3eb5aa7e638ddfc63e42a791
6
+ metadata.gz: 148dc5b5c6a6a8b1437465abfe66081821de1347c1ee1b8bb7ea40bdd98dd73d925d0577b314044ccf9ba4042e7e1e62dd9b8c5ca8de058cd773097985779a1c
7
+ data.tar.gz: c8d67b1091edb45525e4022c4eb39f24845ca2c73c442fde92a137ba4e43bdbbe30cbedf54f29aa3531a843a3fde91d4ab2b36f8134db2d12a1b2b1200c2f608
@@ -0,0 +1,22 @@
1
+ # GitHub actions workflow.
2
+ # https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
3
+
4
+ # https://scan.coverity.com/projects/ohloh_scm
5
+ name: Coverity Scan
6
+
7
+ on:
8
+ push:
9
+ branches: [main]
10
+
11
+ jobs:
12
+ coverity:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v2
16
+ - uses: vapier/coverity-scan-action@v1
17
+ with:
18
+ project: 'Ohloh_SCM'
19
+ build_language: 'other'
20
+ command: '--no-command --fs-capture-search ${{ github.workspace }}'
21
+ email: ${{ secrets.COVERITY_SCAN_EMAIL }}
22
+ token: ${{ secrets.COVERITY_SCAN_TOKEN }}
@@ -26,4 +26,5 @@ GIT_IGNORE_LIST = ['.svn',
26
26
  '*.mov',
27
27
  '*.qt',
28
28
  '*.avi',
29
- '*.xbm'].freeze
29
+ '*.xbm',
30
+ '*.nfs*'].freeze
@@ -60,9 +60,10 @@ module OhlohScm
60
60
  def clean_and_checkout_branch
61
61
  return unless status.scm_dir_exist?
62
62
 
63
- run "cd '#{url}' && git clean -f -d -x"
63
+ run "cd '#{url}' && git clean -f -d -x --exclude='*.nfs*'"
64
64
  return unless status.branch?(branch_name)
65
65
 
66
+ run "cd '#{url}' && git reset --hard HEAD --"
66
67
  run "cd '#{url}' && git checkout #{branch_name} --"
67
68
  run "cd '#{url}' && git reset --hard heads/#{branch_name} --"
68
69
  end
@@ -78,7 +79,7 @@ module OhlohScm
78
79
  def clean_up_disk
79
80
  return unless Dir.exist?(url)
80
81
 
81
- run "cd #{url} && find . -maxdepth 1 -not -name .git -not -name . -print0"\
82
+ run "cd #{url} && find . -maxdepth 1 -not -name .git -not -name '*.nfs*' -not -name . -print0"\
82
83
  ' | xargs -0 rm -rf --'
83
84
  end
84
85
 
@@ -88,7 +88,7 @@ module OhlohScm
88
88
  def clean_up_disk
89
89
  return unless File.exist?(url)
90
90
 
91
- run "cd #{url} && find . -maxdepth 1 -not -name .git -not -name . -print0"\
91
+ run "cd #{url} && find . -maxdepth 1 -not -name .git -not -name '*.nfs*' -not -name . -print0"\
92
92
  ' | xargs -0 rm -rf --'
93
93
  end
94
94
  end
@@ -48,7 +48,7 @@ module OhlohScm
48
48
  def clean_up_disk
49
49
  return unless FileTest.exist?(url)
50
50
 
51
- run "cd #{url} && find . -maxdepth 1 -not -name .hg -not -name . -print0"\
51
+ run "cd #{url} && find . -maxdepth 1 -not -name .hg -not -name '*.nfs*' -not -name . -print0"\
52
52
  ' | xargs -0 rm -rf --'
53
53
  end
54
54
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module OhlohScm
4
4
  module Version
5
- STRING = '3.0.17'
5
+ STRING = '3.0.19'
6
6
  GIT = '2.17.1'
7
7
  SVN = '1.9.7'
8
8
  CVSNT = '2.5.04'
@@ -33,6 +33,42 @@ describe 'Git::Scm' do
33
33
  end
34
34
  end
35
35
 
36
+ it 'must checkout a branch which is behind the default' do
37
+ with_git_repository('git_with_multiple_branch') do |src_core|
38
+ tmpdir do |dest_dir|
39
+ core = OhlohScm::Factory.get_core(scm_type: :git, url: dest_dir, branch_name: 'master')
40
+ core.scm.pull(src_core.scm, TestCallback.new)
41
+
42
+ src_core.scm.branch_name = 'test'
43
+ core = OhlohScm::Factory.get_core(scm_type: :git, url: dest_dir, branch_name: 'test')
44
+ core.scm.pull(src_core.scm, TestCallback.new)
45
+
46
+ remote_master_branch_sha = `cd #{dest_dir} && git rev-parse origin/master`
47
+ remote_test_branch_sha = `cd #{dest_dir} && git rev-parse origin/test`
48
+ master_branch_sha = `cd #{dest_dir} && git rev-parse master`
49
+ test_branch_sha = `cd #{dest_dir} && git rev-parse test`
50
+
51
+ master_branch_sha.must_equal remote_master_branch_sha
52
+ test_branch_sha.must_equal remote_test_branch_sha
53
+ end
54
+ end
55
+ end
56
+
57
+ it 'must handle file changes in multi branch directory' do
58
+ with_git_repository('git_with_multiple_branch', 'test') do |src_core|
59
+ tmpdir do |dest_dir|
60
+ core = OhlohScm::Factory.get_core(scm_type: :git, url: dest_dir, branch_name: 'test')
61
+ refute core.status.scm_dir_exist?
62
+ core.scm.pull(src_core.scm, TestCallback.new)
63
+
64
+ `cd #{dest_dir} && git checkout master`
65
+ `echo 'new change' >> #{dest_dir}/hello.rb`
66
+
67
+ core.scm.pull(src_core.scm, TestCallback.new)
68
+ end
69
+ end
70
+ end
71
+
36
72
  it 'must update branches in local copy' do
37
73
  test_branch_name = 'test' # consider that 'test' is the current *main* branch.
38
74
 
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.17
4
+ version: 3.0.19
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: 2022-09-27 00:00:00.000000000 Z
11
+ date: 2022-11-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |-
14
14
  The OpenHub source control management library for \
@@ -25,6 +25,7 @@ files:
25
25
  - ".bin/run-tests"
26
26
  - ".bin/string_encoder"
27
27
  - ".git_hooks/pre-commit"
28
+ - ".github/workflows/coverity.yml"
28
29
  - ".gitignore"
29
30
  - ".rubocop.yml"
30
31
  - ".ruby-version"