Unverified Commit fc16a228 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Fix blobs for file services


Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 47e6d582edf9
......@@ -24,7 +24,8 @@ def execute
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")
......
......@@ -17,7 +17,8 @@ def execute
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")
......
......@@ -17,7 +17,8 @@ def execute
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")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment