Skip to content

Commit

Permalink
fix: Submodules issue (#300)
Browse files Browse the repository at this point in the history
Signed-off-by: Valentin Kiselev <mrexox@evilmartians.com>
  • Loading branch information
mrexox authored Jul 19, 2022
1 parent 607ba79 commit 16585a2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/git/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@ func NewRepository(fs afero.Fs) (*Repository, error) {
return nil, err
}

hooksSubpath, err := execGit(cmdHooksPath)
hooksPath, err := execGit(cmdHooksPath)
if err != nil {
return nil, err
}
if exists, _ := afero.DirExists(fs, filepath.Join(rootPath, hooksPath)); exists {
hooksPath = filepath.Join(rootPath, hooksPath)
}

gitPath, err := execGit(cmdGitPath)
if err != nil {
Expand All @@ -49,7 +52,7 @@ func NewRepository(fs afero.Fs) (*Repository, error) {

return &Repository{
Fs: fs,
HooksPath: filepath.Join(rootPath, hooksSubpath),
HooksPath: hooksPath,
RootPath: rootPath,
GitPath: gitPath,
}, nil
Expand Down

0 comments on commit 16585a2

Please sign in to comment.