summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <jacob@gitlab.com>2017-10-02 14:39:09 +0200
committerJacob Vosmaer <jacob@gitlab.com>2017-10-02 14:39:09 +0200
commit581272f6d4cfb81b864179df0a69f482d747fa7b (patch)
tree08c7c0b72755557730661e9edc0d4bb11c39e1df
parent83fa3de408d9b34ddfd691e569aadc4bec53ff9a (diff)
downloadgitlab-ce-581272f6d4cfb81b864179df0a69f482d747fa7b.tar.gz
Log update-ref errors in OperationService
-rw-r--r--lib/gitlab/git/operation_service.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/gitlab/git/operation_service.rb b/lib/gitlab/git/operation_service.rb
index 786e2e7e8dc..d835dcca8ba 100644
--- a/lib/gitlab/git/operation_service.rb
+++ b/lib/gitlab/git/operation_service.rb
@@ -152,13 +152,15 @@ module Gitlab
# (and have!) accidentally reset the ref to an earlier state, clobbering
# commits. See also https://github.com/libgit2/libgit2/issues/1534.
command = %W[#{Gitlab.config.git.bin_path} update-ref --stdin -z]
- _, status = popen(
+
+ output, status = popen(
command,
repository.path) do |stdin|
stdin.write("update #{ref}\x00#{newrev}\x00#{oldrev}\x00")
end
unless status.zero?
+ Gitlab::GitLogger.error("'git update-ref' in #{repository.path}: #{output}")
raise Gitlab::Git::CommitError.new(
"Could not update branch #{Gitlab::Git.branch_name(ref)}." \
" Please refresh and try again.")