Skip to content

Commit

Permalink
search git repository not only in specified directory but also in par…
Browse files Browse the repository at this point in the history
…ent directories
  • Loading branch information
Penpen7 committed Nov 5, 2024
1 parent 8e867dc commit adbb326
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/git/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ type (
)

func GetInfo(repoDir string) (*RepositoryInfo, error) {
repo, err := git.PlainOpen(repoDir)
repo, err := git.PlainOpenWithOptions(repoDir, &git.PlainOpenOptions{
DetectDotGit: true,
})
if err != nil {
return nil, fmt.Errorf("failed to open git repo: %w", err)
}
Expand Down

0 comments on commit adbb326

Please sign in to comment.