summaryrefslogtreecommitdiffstats
path: root/pkg/commands/git.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2021-04-10 16:01:46 +1000
committerJesse Duffield <jessedduffield@gmail.com>2021-04-11 17:07:49 +1000
commitbb918b579a3073d786fda83a2bc11c602e442aa0 (patch)
treefe126f12a88db9a9e119d0b172c0902bc0f49244 /pkg/commands/git.go
parente145090046e1693e2100cb0a0ab40a271705f4b0 (diff)
start adding support for logging of commands
Diffstat (limited to 'pkg/commands/git.go')
-rw-r--r--pkg/commands/git.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/pkg/commands/git.go b/pkg/commands/git.go
index 0c15b2788..2745c1935 100644
--- a/pkg/commands/git.go
+++ b/pkg/commands/git.go
@@ -33,7 +33,6 @@ type GitCommand struct {
Tr *i18n.TranslationSet
Config config.AppConfigurer
getGitConfigValue func(string) (string, error)
- removeFile func(string) error
DotGitDir string
onSuccessfulContinue func() error
PatchManager *patch.PatchManager
@@ -75,7 +74,6 @@ func NewGitCommand(log *logrus.Entry, osCommand *oscommands.OSCommand, tr *i18n.
Repo: repo,
Config: config,
getGitConfigValue: getGitConfigValue,
- removeFile: os.RemoveAll,
DotGitDir: dotGitDir,
PushToCurrent: pushToCurrent,
}
@@ -85,6 +83,14 @@ func NewGitCommand(log *logrus.Entry, osCommand *oscommands.OSCommand, tr *i18n.
return gitCommand, nil
}
+func (c *GitCommand) WithSpan(span string) *GitCommand {
+ newGitCommand := &GitCommand{}
+ *newGitCommand = *c
+ newGitCommand.OSCommand = c.OSCommand.WithSpan(span)
+ newGitCommand.PatchManager.ApplyPatch = newGitCommand.ApplyPatch
+ return newGitCommand
+}
+
func navigateToRepoRootDirectory(stat func(string) (os.FileInfo, error), chdir func(string) error) error {
gitDir := env.GetGitDirEnv()
if gitDir != "" {