refactor!: simplifying publish logic
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -34,10 +34,8 @@ func GetRecipeHead(recipeName string) (*plumbing.Reference, error) {
|
||||
}
|
||||
|
||||
// IsClean checks if a repo has unstaged changes
|
||||
func IsClean(recipeName string) (bool, error) {
|
||||
recipeDir := path.Join(config.RECIPES_DIR, recipeName)
|
||||
|
||||
repo, err := git.PlainOpen(recipeDir)
|
||||
func IsClean(repoPath string) (bool, error) {
|
||||
repo, err := git.PlainOpen(repoPath)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
@ -62,9 +60,9 @@ func IsClean(recipeName string) (bool, error) {
|
||||
}
|
||||
|
||||
if status.String() != "" {
|
||||
logrus.Debugf("discovered git status for %s repository: %s", recipeName, status.String())
|
||||
logrus.Debugf("discovered git status in %s: %s", repoPath, status.String())
|
||||
} else {
|
||||
logrus.Debugf("discovered clean git status for %s repository", recipeName)
|
||||
logrus.Debugf("discovered clean git status in %s", repoPath)
|
||||
}
|
||||
|
||||
return status.IsClean(), nil
|
||||
|
Reference in New Issue
Block a user