From 7dfc61decfe24d65645b3d5d6734149ce467ebfa Mon Sep 17 00:00:00 2001 From: Maximilian Moehl Date: Tue, 15 Oct 2024 08:52:55 +0200 Subject: [PATCH] fix: make dirty check more resilient Creating a release will fail even in a clean repo because of unexpected output from git-status when using a non-standard git-status configuration. This commit switches the check from `--short` to `--porcelain` which is intended to produce stable, machine-readable output similar to `--short`. Resolves: #667 --- releasedir/git_repo.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/releasedir/git_repo.go b/releasedir/git_repo.go index cc4dd2167..543b44791 100644 --- a/releasedir/git_repo.go +++ b/releasedir/git_repo.go @@ -74,7 +74,7 @@ func (r FSGitRepo) LastCommitSHA() (string, error) { func (r FSGitRepo) MustNotBeDirty(force bool) (bool, error) { cmd := boshsys.Command{ Name: "git", - Args: []string{"status", "--short"}, + Args: []string{"status", "--porcelain=1"}, WorkingDir: r.dirPath, } stdout, stderr, _, err := r.runner.RunComplexCommand(cmd)