Skip to content

Commit 6da58f4

Browse files
committed
update path search to handle git not found
1 parent 0d8e419 commit 6da58f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/pkg/devcontainers/dockerutils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ type SourceInfo struct {
119119
// getMountFolderFromFolder walks up the path hierarchy checking for a git repo. If found that is returned, if not the original folder is used
120120
func getMountFolderFromFolder(folder string) (string, error) {
121121

122-
for currentFolder := folder; currentFolder != ""; currentFolder = path.Dir(currentFolder) {
122+
for currentFolder := folder; currentFolder != "" && currentFolder != "/"; currentFolder = path.Dir(currentFolder) {
123123
info, err := os.Stat(path.Join(currentFolder, ".git"))
124124
if os.IsNotExist(err) {
125125
continue // walk up the hierarchy

0 commit comments

Comments
 (0)