Skip to content

Commit

Permalink
Add full porcelain status to pr contracts --validate (#569)
Browse files Browse the repository at this point in the history
Apparently git diff doesn't dump out the details of new files (no idea why not).  This will allow the command output to at least show that.
  • Loading branch information
michaeljguarino authored Oct 22, 2024
1 parent 4e8aae3 commit f970b8e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/command/pr/pr.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,13 @@ func handlePrContracts(c *cli.Context) error {
}

if len(changes) > 0 {
utils.Highlight("Contracts failed due to local git changes, displaying below ===>\n\n")
utils.Highlight("Contracts failed due to local git changes, all changed files ===>\n\n")
status, err := git.Status()
if err != nil {
return err
}
fmt.Println(status)
utils.Highlight("Git diff output===>\n")
if err := git.PrintDiff(); err != nil {
return err
}
Expand Down
4 changes: 4 additions & 0 deletions pkg/utils/git/workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ func Modified() ([]string, error) {

return result, nil
}

func Status() (string, error) {
return GitRaw("status", "--porcelain")
}

0 comments on commit f970b8e

Please sign in to comment.