mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-17 00:18:05 +02:00
add test for variety of potential git diff situations
This commit is contained in:
@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
@ -63,3 +64,11 @@ func TrimTrailingNewline(str string) string {
|
||||
}
|
||||
return str
|
||||
}
|
||||
|
||||
// GetProjectRoot returns the path to the root of the project. Only to be used
|
||||
// in testing contexts, as with binaries it's unlikely this path will exist on
|
||||
// the machine
|
||||
func GetProjectRoot() string {
|
||||
gp := os.Getenv("GOPATH")
|
||||
return path.Join(gp, "src/github.com/jesseduffield/lazygit")
|
||||
}
|
||||
|
Reference in New Issue
Block a user