From 616d75a1fa0d9b3995d3dd7b3ab9ca19560d7780 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Sat, 8 Aug 2026 09:35:42 +0200 Subject: [PATCH] Run Reset in the parent module the way the other commands do Reset told git to change directory with -C while runInParentModule does it by setting the command's working directory, but they were computing the same directory for the same reason. Use the helper, so that there is one place that knows what running in a nested submodule's parent means. Co-Authored-By: Claude Opus 5 (1M context) --- pkg/commands/git_commands/submodule.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pkg/commands/git_commands/submodule.go b/pkg/commands/git_commands/submodule.go index e2012942f..f31bd6196 100644 --- a/pkg/commands/git_commands/submodule.go +++ b/pkg/commands/git_commands/submodule.go @@ -199,16 +199,11 @@ func (self *SubmoduleCommands) Stash(submodule *models.SubmoduleConfig) error { } func (self *SubmoduleCommands) Reset(submodule *models.SubmoduleConfig) error { - parentDir := "" - if submodule.ParentModule != nil { - parentDir = submodule.ParentModule.FullPath() - } cmdArgs := NewGitCmd("submodule"). Arg("update", "--init", "--force", "--", submodule.Path). - DirIf(parentDir != "", parentDir). ToArgv() - return self.cmd.New(cmdArgs).Run() + return self.runInParentModule(submodule, self.cmd.New(cmdArgs)) } func (self *SubmoduleCommands) UpdateAll() error {