History

Only write to global gitconfig if necessary (#11876)

* Only write to global gitconfig if necessary Fix #11855 Signed-off-by: Andrew Thornton <art27@cantab.net> * placate lint Signed-off-by: Andrew Thornton <art27@cantab.net>

zeripath committed 6 years ago

Commit ae3cfa81 parent 48842ed2 files · +65 −25Browse files

Showing the changes to modules/process (1 of 2 files). Show all

Unified · Split

modules/process/manager.go+27−1
@@ -157,7 +157,14 @@ func (pm *Manager) ExecDirEnvStdIn(timeout time.Duration, dir, desc string, env · 156 unmodified lines
157 pm.Remove(pid)157 pm.Remove(pid)
158 158
159 if err != nil {159 if err != nil {
160 err = fmt.Errorf("exec(%d:%s) failed: %v(%v) stdout: %v stderr: %v", pid, desc, err, ctx.Err(), stdOut, stdErr)160 err = &Error{
161 PID: pid,
162 Description: desc,
163 Err: err,
164 CtxErr: ctx.Err(),
165 Stdout: stdOut.String(),
166 Stderr: stdErr.String(),
167 }
161 }168 }
162 169
163 return stdOut.String(), stdErr.String(), err170 return stdOut.String(), stdErr.String(), err
@@ -176,3 +183,22 @@ func (l processList) Less(i, j int) bool { · 12 unmodified lines
176func (l processList) Swap(i, j int) {183func (l processList) Swap(i, j int) {
177 l[i], l[j] = l[j], l[i]184 l[i], l[j] = l[j], l[i]
178}185}
186
187// Error is a wrapped error describing the error results of Process Execution
188type Error struct {
189 PID int64
190 Description string
191 Err error
192 CtxErr error
193 Stdout string
194 Stderr string
195}
196
197func (err *Error) Error() string {
198 return fmt.Sprintf("exec(%d:%s) failed: %v(%v) stdout: %s stderr: %s", err.PID, err.Description, err.Err, err.CtxErr, err.Stdout, err.Stderr)
199}
200
201// Unwrap implements the unwrappable implicit interface for go1.13 Unwrap()
202func (err *Error) Unwrap() error {
203 return err.Err
204}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t