Skip to content
Snippets Groups Projects
Commit e7617303 authored by Lin Jen-Shin's avatar Lin Jen-Shin
Browse files

Restore the check for update in commit_file

parent a51f26e5
No related branches found
No related tags found
1 merge request!7237Don't execute git hooks if you create branch as part of other change
Loading
@@ -783,6 +783,14 @@ class Repository
Loading
@@ -783,6 +783,14 @@ class Repository
user, path, content, message, branch, update, user, path, content, message, branch, update,
author_email: nil, author_name: nil, author_email: nil, author_name: nil,
source_branch: nil, source_project: project) 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( multi_action(
user: user, user: user,
branch: branch, branch: branch,
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment