Skip to content

Commit d0f001e

Browse files
cmd/gorelease: migrated git status --porcelain to git diff
The expectation of this application is that it is to be utilized in release pipelines. Due to this expectation, pipelines utilize volume mounting to transfer artifacts (untracked files) across different jobs (specifically referring to GITLAB here). This is a problem because git status --porcelain checks for untracked files and returns them as a list. This causes this pipeline to fail unexpectedly. In testing, `git reset --hard` will not remove these, while a `git clean -fdx` will correctly remove these files. I would recommend that in a follow-up commit there is an update to the available args for this cmd to control if untracked files are to be included or not (eg: --untracked)
1 parent 1b97071 commit d0f001e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmd/gorelease/gorelease.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1507,7 +1507,7 @@ func shortRetractionRationale(rationales []string) (string, bool) {
15071507
// changes.
15081508
func hasGitUncommittedChanges(dir string) (bool, error) {
15091509
stdout := &bytes.Buffer{}
1510-
cmd := exec.Command("git", "status", "--porcelain")
1510+
cmd := exec.Command("git", "diff")
15111511
cmd.Dir = dir
15121512
cmd.Stdout = stdout
15131513
if err := cmd.Run(); err != nil {

0 commit comments

Comments
 (0)