diff options
author | Jacob Vosmaer <jacob@gitlab.com> | 2016-09-02 17:54:09 +0200 |
---|---|---|
committer | Jacob Vosmaer <jacob@gitlab.com> | 2016-09-02 17:54:09 +0200 |
commit | ffef94f17e16a9ca9f0c1d1b970f2354d5144357 (patch) | |
tree | 4a187ace15f1aac6b772374f81a02cb232a87531 /app | |
parent | a93a610bac7d9ee7c0908592b6a5d91ef0d94333 (diff) | |
download | gitlab-ce-ffef94f17e16a9ca9f0c1d1b970f2354d5144357.tar.gz |
Make error message appropriate for end users
Diffstat (limited to 'app')
-rw-r--r-- | app/models/repository.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index b0644259af8..414b82516bc 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -221,13 +221,13 @@ class Repository # (and have!) accidentally reset the ref to an earlier state, clobbering # commits. See also https://github.com/libgit2/libgit2/issues/1534. command = %w[git update-ref --stdin -z] - output, status = Gitlab::Popen.popen(command, path_to_repo) do |stdin| + _, status = Gitlab::Popen.popen(command, path_to_repo) do |stdin| stdin.write("update #{name}\x00#{newrev}\x00#{oldrev}\x00") end return if status.zero? - raise CommitError.new("error updating ref #{name} #{oldrev}->#{newrev}\n#{output}") + raise CommitError.new("Could not update branch #{name.sub('refs/heads/', '')}. Please refresh and try again.") end # Makes sure a commit is kept around when Git garbage collection runs. |