danger 9.3.0 → 9.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/danger/scm_source/git_repo.rb +23 -7
- data/lib/danger/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 719588ed490c1115e2439aabacb0dd400e1852bf03a0f25514b26dcb08e0ad9e
|
4
|
+
data.tar.gz: 7426ab63483923ceffd843789c473a46f7726b1f9057a74b558bbeeb2c6948d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9fa39fb8d2a11ac973a1c4b7a9647bef1a0bfdd36411d403e1f3121b3a1b7490dbaa7489c17f018fa1ae88be4ceccc6ee213267ee32133dfbf162cb3bab93e6f
|
7
|
+
data.tar.gz: 01ba1c81cfdb4a37661826f913ed3227e1432fbbede1d69e6521eacfd4d6c8595f8a5140134c431446b591f81027797a4f93b67b674fcfd9c860d452575ea5fb
|
@@ -8,13 +8,9 @@ module Danger
|
|
8
8
|
|
9
9
|
def diff_for_folder(folder, from: "master", to: "HEAD", lookup_top_level: false)
|
10
10
|
self.folder = folder
|
11
|
-
git_top_level = folder
|
12
|
-
|
13
|
-
|
14
|
-
git_top_level = exec("rev-parse --show-toplevel")
|
15
|
-
end
|
16
|
-
end
|
17
|
-
repo = Git.open git_top_level
|
11
|
+
git_top_level = find_git_top_level_if_needed!(folder, lookup_top_level)
|
12
|
+
|
13
|
+
repo = Git.open(git_top_level)
|
18
14
|
|
19
15
|
ensure_commitish_exists!(from)
|
20
16
|
ensure_commitish_exists!(to)
|
@@ -168,6 +164,26 @@ module Danger
|
|
168
164
|
def commit_is_ref?(commit)
|
169
165
|
/[a-f0-9]{5,40}/ !~ commit
|
170
166
|
end
|
167
|
+
|
168
|
+
def find_git_top_level_if_needed!(folder, lookup_top_level)
|
169
|
+
git_top_level = Dir.chdir(folder) { exec("rev-parse --show-toplevel") }
|
170
|
+
return git_top_level if lookup_top_level
|
171
|
+
|
172
|
+
# To keep backward compatibility, `GitRepo#diff_for_folder` expects folder
|
173
|
+
# to be top level git directory or requires `true` to `lookup_top_level`.
|
174
|
+
# https://github.com/danger/danger/pull/1178
|
175
|
+
return folder if compare_path(git_top_level, folder)
|
176
|
+
|
177
|
+
message = "#{folder} is not the top level git directory. Pass correct path or `true` to `lookup_top_level` option for `diff_for_folder`"
|
178
|
+
raise ArgumentError, message
|
179
|
+
end
|
180
|
+
|
181
|
+
# Compare given paths as realpath. Return true if both are same.
|
182
|
+
# `git rev-parse --show-toplevel` returns a path resolving symlink. In rspec, given path can
|
183
|
+
# be a temporary directory's path created under a symlinked directory `/var`.
|
184
|
+
def compare_path(path1, path2)
|
185
|
+
Pathname.new(path1).realdirpath == Pathname.new(path2).realdirpath
|
186
|
+
end
|
171
187
|
end
|
172
188
|
end
|
173
189
|
|
data/lib/danger/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: danger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 9.3.
|
4
|
+
version: 9.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Orta Therox
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-
|
12
|
+
date: 2023-06-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: claide
|
@@ -107,14 +107,14 @@ dependencies:
|
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 1.13
|
110
|
+
version: '1.13'
|
111
111
|
type: :runtime
|
112
112
|
prerelease: false
|
113
113
|
version_requirements: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 1.13
|
117
|
+
version: '1.13'
|
118
118
|
- !ruby/object:Gem::Dependency
|
119
119
|
name: kramdown
|
120
120
|
requirement: !ruby/object:Gem::Requirement
|
@@ -163,14 +163,14 @@ dependencies:
|
|
163
163
|
requirements:
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: '
|
166
|
+
version: '6.0'
|
167
167
|
type: :runtime
|
168
168
|
prerelease: false
|
169
169
|
version_requirements: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
171
|
- - "~>"
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: '
|
173
|
+
version: '6.0'
|
174
174
|
- !ruby/object:Gem::Dependency
|
175
175
|
name: terminal-table
|
176
176
|
requirement: !ruby/object:Gem::Requirement
|