From ba230d48166dddf361f95b5669f057e5e8ed948c Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Fri, 3 May 2024 16:45:37 +0900 Subject: [PATCH] fix: add `--porcelain` to `git status --short` --- internal/git/repository.go | 2 +- internal/git/repository_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/git/repository.go b/internal/git/repository.go index cde27ae1..d21fb040 100644 --- a/internal/git/repository.go +++ b/internal/git/repository.go @@ -24,7 +24,7 @@ var ( cmdPushFilesBase = []string{"git", "diff", "--name-only", "HEAD", "@{push}"} cmdPushFilesHead = []string{"git", "diff", "--name-only", "HEAD"} cmdStagedFiles = []string{"git", "diff", "--name-only", "--cached", "--diff-filter=ACMR"} - cmdStatusShort = []string{"git", "status", "--short"} + cmdStatusShort = []string{"git", "status", "--short", "--porcelain"} cmdListStash = []string{"git", "stash", "list"} cmdRootPath = []string{"git", "rev-parse", "--show-toplevel"} cmdHooksPath = []string{"git", "rev-parse", "--git-path", "hooks"} diff --git a/internal/git/repository_test.go b/internal/git/repository_test.go index 44980422..5a189bd8 100644 --- a/internal/git/repository_test.go +++ b/internal/git/repository_test.go @@ -39,7 +39,7 @@ MM staged but changed Git: &CommandExecutor{ exec: GitMock{ cases: map[string]string{ - "git status --short": tt.gitOut, + "git status --short --porcelain": tt.gitOut, }, }, },