updateref: Setup a cause of the failure
When Prepare() or Commit() method of the Updater was called inside UpdaterWithHooks#UpdateReference method the errors returned were thrown away. Because of it we were missing important part of the failure cause - the output of the failed git operation. In order to fix it we now return it as part of the Error instance. The call sites inspects the error and logs it in case there is any metadata associated with it. Closes: https://gitlab.com/gitlab-org/gitaly/-/issues/4677 Changelog: added
Showing
- internal/git/updateref/update_with_hooks.go 4 additions, 0 deletionsinternal/git/updateref/update_with_hooks.go
- internal/gitaly/service/operations/branches.go 7 additions, 0 deletionsinternal/gitaly/service/operations/branches.go
- internal/gitaly/service/operations/branches_test.go 30 additions, 7 deletionsinternal/gitaly/service/operations/branches_test.go
- internal/gitaly/service/operations/merge.go 6 additions, 0 deletionsinternal/gitaly/service/operations/merge.go
- internal/gitaly/service/operations/merge_test.go 15 additions, 1 deletioninternal/gitaly/service/operations/merge_test.go
- internal/gitaly/service/operations/submodules.go 3 additions, 0 deletionsinternal/gitaly/service/operations/submodules.go
- internal/gitaly/service/operations/submodules_test.go 30 additions, 5 deletionsinternal/gitaly/service/operations/submodules_test.go
- internal/gitaly/service/operations/tags.go 7 additions, 0 deletionsinternal/gitaly/service/operations/tags.go
- internal/gitaly/service/operations/tags_test.go 24 additions, 1 deletioninternal/gitaly/service/operations/tags_test.go
- internal/gitaly/service/operations/testhelper_test.go 2 additions, 0 deletionsinternal/gitaly/service/operations/testhelper_test.go
- internal/gitaly/service/operations/utils_test.go 14 additions, 0 deletionsinternal/gitaly/service/operations/utils_test.go
Please register or sign in to comment