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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
e36088dd
Commit
e36088dd
authored
Dec 08, 2016
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
We need to normalize the path for all actions
parent
4b3c18ce
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
app/models/repository.rb
app/models/repository.rb
+6
-4
No files found.
app/models/repository.rb
View file @
e36088dd
...
...
@@ -766,7 +766,7 @@ class Repository
commit_file
(
user
,
"
#{
Gitlab
::
Git
::
PathHelper
.
normalize_path
(
path
)
}
/.gitkeep"
,
"
#{
path
}
/.gitkeep"
,
''
,
message
,
branch
,
...
...
@@ -871,12 +871,14 @@ class Repository
end
actions
.
each
do
|
action
|
path
=
Gitlab
::
Git
::
PathHelper
.
normalize_path
(
action
[
:file_path
]).
to_s
case
action
[
:action
]
when
:create
,
:update
,
:move
mode
=
case
action
[
:action
]
when
:update
index
.
get
(
action
[
:file_path
]
)[
:mode
]
index
.
get
(
path
)[
:mode
]
when
:move
index
.
get
(
action
[
:previous_path
])[
:mode
]
end
...
...
@@ -887,9 +889,9 @@ class Repository
content
=
action
[
:encoding
]
==
'base64'
?
Base64
.
decode64
(
action
[
:content
])
:
action
[
:content
]
oid
=
rugged
.
write
(
content
,
:blob
)
index
.
add
(
path:
action
[
:file_path
]
,
oid:
oid
,
mode:
mode
)
index
.
add
(
path:
path
,
oid:
oid
,
mode:
mode
)
when
:delete
index
.
remove
(
action
[
:file_path
]
)
index
.
remove
(
path
)
end
end
...
...
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