diff options
author | zeripath <art27@cantab.net> | 2020-01-20 01:32:47 +0000 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2020-01-20 09:32:47 +0800 |
commit | 54c2854cd2c4084ead621fa42565100338ff3467 (patch) | |
tree | 92c1086d5be97930e95481c1d58238c52b50a396 /modules/repofiles | |
parent | dcf7e858cb5d97389c4784227bfb93b9076938e6 (diff) | |
download | gitea-54c2854cd2c4084ead621fa42565100338ff3467.tar.gz gitea-54c2854cd2c4084ead621fa42565100338ff3467.zip |
Give the stdout on temp_repo error (#9871)
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'modules/repofiles')
-rw-r--r-- | modules/repofiles/temp_repo.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/repofiles/temp_repo.go b/modules/repofiles/temp_repo.go index a1cc37e8c6..f7e3935c25 100644 --- a/modules/repofiles/temp_repo.go +++ b/modules/repofiles/temp_repo.go @@ -243,9 +243,9 @@ func (t *TemporaryUploadRepository) Push(doer *models.User, commitHash string, b // Because calls hooks we need to pass in the environment env := models.PushingEnvironment(doer, t.repo) - if _, err := git.NewCommand("push", t.repo.RepoPath(), strings.TrimSpace(commitHash)+":refs/heads/"+strings.TrimSpace(branch)).RunInDirWithEnv(t.basePath, env); err != nil { - log.Error("Unable to push back to repo from temporary repo: %s (%s) Error: %v", - t.repo.FullName(), t.basePath, err) + if stdout, err := git.NewCommand("push", t.repo.RepoPath(), strings.TrimSpace(commitHash)+":refs/heads/"+strings.TrimSpace(branch)).RunInDirWithEnv(t.basePath, env); err != nil { + log.Error("Unable to push back to repo from temporary repo: %s (%s)\nStdout: %s\nError: %v", + t.repo.FullName(), t.basePath, stdout, err) return fmt.Errorf("Unable to push back to repo from temporary repo: %s (%s) Error: %v", t.repo.FullName(), t.basePath, err) } |