Skip to content

Commit da7ffa0

Browse files
lewis-yeungJanDeDobbeleer
authored andcommitted
refactor(shell): use exec.CommandContext instead of exec.Command
1 parent 80059b9 commit da7ffa0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/shell/git.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package shell
22

33
import (
4+
context_ "context"
45
"fmt"
56
"os/exec"
67
"strings"
@@ -62,8 +63,7 @@ func (a *Alias) getGitAliasOutput() (string, error) {
6263
if err != nil {
6364
return "", err
6465
}
65-
66-
cmd := exec.Command(path, "config", "--get-regexp", "^alias\\.")
66+
cmd := exec.CommandContext(context_.Background(), path, "config", "--get-regexp", "^alias\\.")
6767
// when no aliae have been set, it causes git to panic
6868
raw, _ := cmd.Output()
6969
return string(raw), nil

0 commit comments

Comments
 (0)