Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
5b3b2b82
Commit
5b3b2b82
authored
Feb 14, 2018
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify license generator error handling
parent
bc11af67
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
app/models/repository.rb
app/models/repository.rb
+1
-1
spec/models/repository_spec.rb
spec/models/repository_spec.rb
+2
-3
No files found.
app/models/repository.rb
View file @
5b3b2b82
...
@@ -597,7 +597,7 @@ class Repository
...
@@ -597,7 +597,7 @@ class Repository
# The licensee gem creates a Rugged object from the path:
# The licensee gem creates a Rugged object from the path:
# https://github.com/benbalter/licensee/blob/v8.7.0/lib/licensee/projects/git_project.rb
# https://github.com/benbalter/licensee/blob/v8.7.0/lib/licensee/projects/git_project.rb
begin
begin
Licensee
.
project
(
path
,
revision:
head_commit
.
sha
).
license
.
try
(
:key
)
Licensee
.
license
(
path
)
.
try
(
:key
)
# Normally we would rescue Rugged::Error, but that is banned by lint-rugged
# Normally we would rescue Rugged::Error, but that is banned by lint-rugged
# and we need to migrate this endpoint to Gitaly:
# and we need to migrate this endpoint to Gitaly:
# https://gitlab.com/gitlab-org/gitaly/issues/1026
# https://gitlab.com/gitlab-org/gitaly/issues/1026
...
...
spec/models/repository_spec.rb
View file @
5b3b2b82
...
@@ -879,11 +879,10 @@ describe Repository do
...
@@ -879,11 +879,10 @@ describe Repository do
expect
(
repository
.
license_key
).
to
be_nil
expect
(
repository
.
license_key
).
to
be_nil
end
end
it
'returns
the license key even
when master does not exist'
do
it
'returns
nil
when master does not exist'
do
repository
.
rm_branch
(
user
,
'master'
)
repository
.
rm_branch
(
user
,
'master'
)
project
.
change_head
(
'test'
)
expect
(
repository
.
license_key
).
to
eq
(
'mit'
)
expect
(
repository
.
license_key
).
to
be_nil
end
end
it
'returns the license key'
do
it
'returns the license key'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment