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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
fc16a228
Commit
fc16a228
authored
Feb 05, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix blobs for file services
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
31987259
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
3 deletions
+6
-3
app/services/files/create_service.rb
app/services/files/create_service.rb
+2
-1
app/services/files/delete_service.rb
app/services/files/delete_service.rb
+2
-1
app/services/files/update_service.rb
app/services/files/update_service.rb
+2
-1
No files found.
app/services/files/create_service.rb
View file @
fc16a228
...
...
@@ -24,7 +24,8 @@ module Files
return
error
(
"Your changes could not be committed, because file name contains not allowed characters"
)
end
blob
=
repository
.
blob_at
(
ref
,
file_path
)
commit
=
repository
.
commit
(
ref
)
blob
=
repository
.
blob_at
(
commit
.
sha
,
file_path
)
if
blob
return
error
(
"Your changes could not be committed, because file with such name exists"
)
...
...
app/services/files/delete_service.rb
View file @
fc16a228
...
...
@@ -17,7 +17,8 @@ module Files
return
error
(
"You can only create files if you are on top of a branch"
)
end
blob
=
repository
.
blob_at
(
ref
,
path
)
commit
=
repository
.
commit
(
ref
)
blob
=
repository
.
blob_at
(
commit
.
sha
,
path
)
unless
blob
return
error
(
"You can only edit text files"
)
...
...
app/services/files/update_service.rb
View file @
fc16a228
...
...
@@ -17,7 +17,8 @@ module Files
return
error
(
"You can only create files if you are on top of a branch"
)
end
blob
=
repository
.
blob_at
(
ref
,
path
)
commit
=
repository
.
commit
(
ref
)
blob
=
repository
.
blob_at
(
commit
.
sha
,
path
)
unless
blob
return
error
(
"You can only edit text files"
)
...
...
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