1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

Extend submodule tests to use a submodule where name and path are different

In most real-world scenarios, name and path are usually the same. They don't
have to be though, and it's important to make sure we use the right one when
passing arguments to git commands, so change the tests to have different name
and path.
This commit is contained in:
Stefan Haller
2024-02-10 19:42:30 +01:00
parent ad017459d2
commit 85a6a42bff
5 changed files with 39 additions and 22 deletions

View File

@ -2,7 +2,10 @@ package components
import (
"fmt"
"log"
"strings"
"github.com/jesseduffield/lazygit/pkg/commands/git_commands"
)
type Git struct {
@ -44,3 +47,11 @@ func (self *Git) expect(cmdArgs []string, condition func(string) (bool, string))
return self
}
func (self *Git) Version() *git_commands.GitVersion {
version, err := getGitVersion()
if err != nil {
log.Fatalf("Could not get git version: %v", err)
}
return version
}