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
b3faaa9c
Commit
b3faaa9c
authored
Feb 19, 2021
by
Francisco Javier López
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix snippet commit bug because of different Gitaly error
parent
b8d307ac
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
+10
-2
app/models/snippet_repository.rb
app/models/snippet_repository.rb
+4
-2
changelogs/unreleased/322096-fj-fix-regression-in-snippet-background-migration.yml
...096-fj-fix-regression-in-snippet-background-migration.yml
+5
-0
spec/models/snippet_repository_spec.rb
spec/models/snippet_repository_spec.rb
+1
-0
No files found.
app/models/snippet_repository.rb
View file @
b3faaa9c
...
...
@@ -115,8 +115,10 @@ class SnippetRepository < ApplicationRecord
end
def
invalid_path_error?
(
err
)
err
.
is_a?
(
Gitlab
::
Git
::
Index
::
IndexError
)
&&
err
.
message
.
downcase
.
start_with?
(
'invalid path'
,
'path cannot include directory traversal'
)
(
err
.
is_a?
(
Gitlab
::
Git
::
Index
::
IndexError
)
&&
err
.
message
.
downcase
.
start_with?
(
'invalid path'
,
'path cannot include directory traversal'
))
||
(
err
.
is_a?
(
Gitlab
::
Git
::
CommandError
)
&&
err
.
message
.
include?
(
'CreateFile: invalid path'
))
end
def
invalid_signature_error?
(
err
)
...
...
changelogs/unreleased/322096-fj-fix-regression-in-snippet-background-migration.yml
0 → 100644
View file @
b3faaa9c
---
title
:
Fix snippet commit bug because of different Gitaly error
merge_request
:
54662
author
:
type
:
fixed
spec/models/snippet_repository_spec.rb
View file @
b3faaa9c
...
...
@@ -286,6 +286,7 @@ RSpec.describe SnippetRepository do
context
'with git errors'
do
it_behaves_like
'snippet repository with git errors'
,
'invalid://path/here'
,
described_class
::
InvalidPathError
it_behaves_like
'snippet repository with git errors'
,
'.git/hooks/pre-commit'
,
described_class
::
InvalidPathError
it_behaves_like
'snippet repository with git errors'
,
'../../path/traversal/here'
,
described_class
::
InvalidPathError
it_behaves_like
'snippet repository with git errors'
,
'README'
,
described_class
::
CommitError
...
...
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