[PR #56] [MERGED] Return error from cmd.Wait() #66

Closed
opened 2026-02-16 10:24:00 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/git/pull/56
Author: @ethantkoenig
Created: 5/28/2017
Status: Merged
Merged: 5/29/2017
Merged by: @lunny

Base: masterHead: fix_command


📝 Commits (1)

  • af5e39c Return error from cmd.Wait()

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 command.go (+1 -1)

📄 Description

Check and return the error returned by cmd.Wait(), instead of quietly logging and ignoring.

Ignoring this error, because the subsequent call to ctx.Err() may return nil even if cmd.Wait() returned an actual error. For instance, git show-ref --verify <non-existent-branch> will fail with a exit code of 128, and cmd.Wait() will return an error, but cmd.Wait() will return nil.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/git/pull/56 **Author:** [@ethantkoenig](https://github.com/ethantkoenig) **Created:** 5/28/2017 **Status:** ✅ Merged **Merged:** 5/29/2017 **Merged by:** [@lunny](https://github.com/lunny) **Base:** `master` ← **Head:** `fix_command` --- ### 📝 Commits (1) - [`af5e39c`](https://github.com/go-gitea/git/commit/af5e39c47c12032dae0732b72a9f7c1321930441) Return error from cmd.Wait() ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `command.go` (+1 -1) </details> ### 📄 Description Check and return the error returned by `cmd.Wait()`, instead of quietly logging and ignoring. Ignoring this error, because the subsequent call to `ctx.Err()` may return `nil` even if `cmd.Wait()` returned an actual error. For instance, `git show-ref --verify <non-existent-branch>` will fail with a exit code of 128, and `cmd.Wait()` will return an error, but `cmd.Wait()` will return `nil`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 10:24:00 -05:00
yindo closed this issue 2026-02-16 10:24:00 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: go-gitea/git#66