chef-cli 5.6.12 → 5.6.14
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5ace4297d04cb8c5d06220ff10b33482402d8addc46666af48ec7d4d059216d
|
4
|
+
data.tar.gz: df9ff23ccab179fef3074f774955c5c14e338aa19428b38c375ad2a2378c48da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f2ec47a77bba0c528f942824c138586690dff1a0069841df0981fd27d91b7e15c431c0065de241e22476fcccf78f76ece7c306180182ee3e1c864c970c0565c
|
7
|
+
data.tar.gz: 87b4e9babe9b75b4469a96eebea4467f2165d5eb0daf738b296647469e58dd6025117d38d53301774913e10808faf5ddcaa6c2a75136b810afe7ca12932132f6
|
@@ -23,10 +23,17 @@ module ChefCLI
|
|
23
23
|
|
24
24
|
include Helpers
|
25
25
|
|
26
|
+
@@git_memo = {}
|
27
|
+
|
26
28
|
attr_reader :cookbook_path
|
27
29
|
|
30
|
+
def self.uncache
|
31
|
+
@@git_memo = {}
|
32
|
+
end
|
33
|
+
|
28
34
|
def initialize(cookbook_path)
|
29
35
|
@cookbook_path = cookbook_path
|
36
|
+
@repo_path = nil
|
30
37
|
@unborn_branch = nil
|
31
38
|
@unborn_branch_ref = nil
|
32
39
|
end
|
@@ -111,8 +118,24 @@ module ChefCLI
|
|
111
118
|
end
|
112
119
|
|
113
120
|
def git(subcommand, options = {})
|
114
|
-
|
115
|
-
|
121
|
+
# memoize commands per-repo
|
122
|
+
repo_path = get_repo_path
|
123
|
+
memo_key = [repo_path, subcommand, options]
|
124
|
+
if @@git_memo.key?(memo_key)
|
125
|
+
rv = @@git_memo[memo_key]
|
126
|
+
else
|
127
|
+
options = { cwd: cookbook_path }.merge(options)
|
128
|
+
rv = system_command("git #{subcommand}", options)
|
129
|
+
@@git_memo[memo_key] = rv
|
130
|
+
end
|
131
|
+
rv
|
132
|
+
end
|
133
|
+
|
134
|
+
def get_repo_path
|
135
|
+
unless @repo_path
|
136
|
+
@repo_path = system_command("git rev-parse --show-toplevel", { cwd: cookbook_path }).stdout.strip
|
137
|
+
end
|
138
|
+
@repo_path
|
116
139
|
end
|
117
140
|
|
118
141
|
def detect_current_branch
|
data/lib/chef-cli/version.rb
CHANGED
@@ -50,6 +50,10 @@ describe ChefCLI::PolicyfileLock, "building a lockfile", :skip_on_windows do
|
|
50
50
|
ChefCLI::Policyfile::StorageConfig.new( cache_path: cache_path, relative_paths_root: relative_paths_root )
|
51
51
|
end
|
52
52
|
|
53
|
+
let!(:git_memo) do
|
54
|
+
ChefCLI::CookbookProfiler::Git.uncache
|
55
|
+
end
|
56
|
+
|
53
57
|
context "when a cached cookbook omits the cache key" do
|
54
58
|
|
55
59
|
let(:policyfile_lock) do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.6.
|
4
|
+
version: 5.6.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chef Software, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-cli
|