Skip to content

Commit

Permalink
Allow calling sync from within a subfolder of a repo
Browse files Browse the repository at this point in the history
  • Loading branch information
vHanda committed May 12, 2022
1 parent 1ef7809 commit eac8e50
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion common/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

func fetch(repoPath string) error {
r, err := git.PlainOpen(repoPath)
r, err := git.PlainOpenWithOptions(repoPath, &git.PlainOpenOptions{DetectDotGit: true})
if err != nil {
return tracerr.Wrap(err)
}
Expand Down
2 changes: 1 addition & 1 deletion common/ignore.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func shouldIgnoreFile(repoPath string, fullFilePath string) (bool, error) {
}

func isFileIgnoredByGit(repoPath string, filePath string) (bool, error) {
repo, err := git.PlainOpen(repoPath)
repo, err := git.PlainOpenWithOptions(repoPath, &git.PlainOpenOptions{DetectDotGit: true})
if err != nil {
return false, tracerr.Wrap(err)
}
Expand Down
2 changes: 1 addition & 1 deletion common/rebase.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ type branchInfo struct {
}

func fetchBranchInfo(repoPath string) (branchInfo, error) {
repo, err := git.PlainOpen(repoPath)
repo, err := git.PlainOpenWithOptions(repoPath, &git.PlainOpenOptions{DetectDotGit: true})
if err != nil {
return branchInfo{}, tracerr.Wrap(err)
}
Expand Down
2 changes: 1 addition & 1 deletion daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func isValidGitRepo(repoPath string) error {
return tracerr.Errorf("%w - %s", errRepoPathInvalid, repoPath)
}

_, err = git.PlainOpen(repoPath)
_, err = git.PlainOpenWithOptions(repoPath, &git.PlainOpenOptions{DetectDotGit: true})
if err != nil {
return tracerr.Errorf("Not a valid git repo - %s\n%w", repoPath, err)
}
Expand Down

0 comments on commit eac8e50

Please sign in to comment.