diff options
author | Gustavo Andrioli <gusaandrioli@gmail.com> | 2022-10-15 13:47:55 -0300 |
---|---|---|
committer | Gustavo Andrioli <gusaandrioli@gmail.com> | 2022-10-15 13:55:44 -0300 |
commit | 39e84e13f4ed80ff94b2a1fc6e66685c24fa6d1e (patch) | |
tree | f640b2a2e78f8485dbc9a6d504c1366e19c67224 /pkg/utils | |
parent | 05089b9a9a26502c2c4b92f20e60979ce02bca67 (diff) |
Use lazycore utils: Clamp and GetLazyRootDirectory
Diffstat (limited to 'pkg/utils')
-rw-r--r-- | pkg/utils/utils.go | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 9d6213c1d..2f33862e8 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -135,30 +135,3 @@ func FilePath(skip int) string { _, path, _, _ := runtime.Caller(skip) return path } - -// for our cheatsheet script and integration tests. Not to be confused with finding the -// root directory of _any_ random repo. -func GetLazygitRootDirectory() string { - path, err := os.Getwd() - if err != nil { - panic(err) - } - - for { - _, err := os.Stat(filepath.Join(path, ".git")) - - if err == nil { - return path - } - - if !os.IsNotExist(err) { - panic(err) - } - - path = filepath.Dir(path) - - if path == "/" { - log.Fatal("must run in lazygit folder or child folder") - } - } -} |