Log update-ref errors in OperationService
This commit is contained in:
parent
83fa3de408
commit
581272f6d4
1 changed files with 3 additions and 1 deletions
|
@ -152,13 +152,15 @@ module Gitlab
|
||||||
# (and have!) accidentally reset the ref to an earlier state, clobbering
|
# (and have!) accidentally reset the ref to an earlier state, clobbering
|
||||||
# commits. See also https://github.com/libgit2/libgit2/issues/1534.
|
# commits. See also https://github.com/libgit2/libgit2/issues/1534.
|
||||||
command = %W[#{Gitlab.config.git.bin_path} update-ref --stdin -z]
|
command = %W[#{Gitlab.config.git.bin_path} update-ref --stdin -z]
|
||||||
_, status = popen(
|
|
||||||
|
output, status = popen(
|
||||||
command,
|
command,
|
||||||
repository.path) do |stdin|
|
repository.path) do |stdin|
|
||||||
stdin.write("update #{ref}\x00#{newrev}\x00#{oldrev}\x00")
|
stdin.write("update #{ref}\x00#{newrev}\x00#{oldrev}\x00")
|
||||||
end
|
end
|
||||||
|
|
||||||
unless status.zero?
|
unless status.zero?
|
||||||
|
Gitlab::GitLogger.error("'git update-ref' in #{repository.path}: #{output}")
|
||||||
raise Gitlab::Git::CommitError.new(
|
raise Gitlab::Git::CommitError.new(
|
||||||
"Could not update branch #{Gitlab::Git.branch_name(ref)}." \
|
"Could not update branch #{Gitlab::Git.branch_name(ref)}." \
|
||||||
" Please refresh and try again.")
|
" Please refresh and try again.")
|
||||||
|
|
Loading…
Reference in a new issue