File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -3,12 +3,12 @@ package utils
33import "strings"
44
55// IsDirty checks whether a repository is in a dirty state (has uncommitted changes).
6- func IsDirty () bool {
6+ func IsDirty () ( bool , string ) {
77 out , err := RunCommand ("git" , "status" , "--porcelain" )
88 if strings .TrimSpace (out ) != "" || err != nil {
9- return true
9+ return true , out
1010 }
11- return false
11+ return false , ""
1212}
1313
1414// GetTag gets the latest git tag for a repository.
Original file line number Diff line number Diff line change @@ -43,11 +43,12 @@ func (Stage) Run(ctx *ctx.Context) error {
4343 }
4444
4545 log .Debug ("checking if git is in a clean state" )
46- if utils .IsDirty () {
46+ if isDirty , out := utils .IsDirty (); isDirty {
4747 if ctx .AllowDirty {
4848 log .Info ("allowing git to be in a dirty state" )
4949 } else {
5050 if err := ctx .CheckDryRun (ErrDirtyGit ); err != nil {
51+ log .Errorf ("dirty git state detected\n " + out )
5152 return err
5253 }
5354 }
You can’t perform that action at this time.
0 commit comments