forked from toolshed/abra
feat: diff on release flow
Also, don't commit unstaged files.
This commit is contained in:
@ -8,7 +8,7 @@ import (
|
||||
)
|
||||
|
||||
// Commit runs a git commit
|
||||
func Commit(repoPath, glob, commitMessage string, dryRun bool) error {
|
||||
func Commit(repoPath, commitMessage string, dryRun bool) error {
|
||||
if commitMessage == "" {
|
||||
return fmt.Errorf("no commit message specified?")
|
||||
}
|
||||
@ -33,17 +33,8 @@ func Commit(repoPath, glob, commitMessage string, dryRun bool) error {
|
||||
}
|
||||
|
||||
if !dryRun {
|
||||
err = commitWorktree.AddGlob(glob)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
logrus.Debugf("staged %s for commit", glob)
|
||||
} else {
|
||||
logrus.Debugf("dry run: did not stage %s for commit", glob)
|
||||
}
|
||||
|
||||
if !dryRun {
|
||||
_, err = commitWorktree.Commit(commitMessage, &git.CommitOptions{})
|
||||
// NOTE(d1): `All: true` does not include untracked files
|
||||
_, err = commitWorktree.Commit(commitMessage, &git.CommitOptions{All: true})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user