Skip to content

Commit 1807ac6

Browse files
authored
Merge pull request #190 from tjgurwara99/tjgurwara99/recursively-check-parent-dirs-until-dot-git-is-found
Recursively check parent dirs until .git directory is found
2 parents 74ee659 + def1ac4 commit 1807ac6

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

cmd/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ var rootCmd = &cobra.Command{
6565
var currentRepository repository.Repository
6666
var reference string
6767
if rootFlags.repository == "" {
68-
gitRepository, err := git.PlainOpen(".")
68+
gitRepository, err := git.PlainOpenWithOptions(".", &git.PlainOpenOptions{DetectDotGit: true})
6969
if err != nil {
7070
return errors.Wrap(err, "Unable to open git repository.")
7171
}

internal/locator/local_locator.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ func getRepositoryRoot() (string, error) {
6868
if !os.IsNotExist(err) {
6969
return "", errors.Wrapf(err, "Unable to stat git directory \"%s\".", gitDirectory)
7070
}
71-
continue
7271
} else {
7372
if stat.IsDir() {
7473
return path, nil

0 commit comments

Comments
 (0)