diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-10-02 15:32:59 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-10-02 15:32:59 +0000 |
commit | 1440342fcfd02c7ef84fe152d19d3183de2ff8e6 (patch) | |
tree | 868ed84586bafd18b3c48883d25d53bd0edbae80 /lib | |
parent | 8bd9d0963b674a13cdd5aef85ab447801de168f1 (diff) | |
parent | 581272f6d4cfb81b864179df0a69f482d747fa7b (diff) | |
download | gitlab-ce-1440342fcfd02c7ef84fe152d19d3183de2ff8e6.tar.gz |
Merge branch 'log-update-ref-errors' into 'master'
Log update-ref errors in OperationService
See merge request gitlab-org/gitlab-ce!14627
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/git/operation_service.rb | 4 |
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.") |