Restore the check for update in commit_file

This commit is contained in:
Lin Jen-Shin 2016-12-08 01:13:16 +08:00
parent a51f26e514
commit e76173038b
1 changed files with 8 additions and 0 deletions

View File

@ -783,6 +783,14 @@ class Repository
user, path, content, message, branch, update,
author_email: nil, author_name: nil,
source_branch: nil, source_project: project)
if branch_exists?(branch) && update == false
# tree_entry is private
if raw_repository.send(:tree_entry, commit(branch), path)
raise Gitlab::Git::Repository::InvalidBlobName.new(
"Filename already exists; update not allowed")
end
end
multi_action(
user: user,
branch: branch,