The git command 'git status --short' is porcelain and may
incorrectly identify clean git trees as dirty if
status.branch git config is set.
Use git-diff-index plumbing instead.
Details
- Reviewers
mpyne - Group Reviewers
kdesrc-build - Commits
- R365:bacb2b2ae212: git: Fix detection of repos with local changes to stash.
The bug can be reproduced globally for all trees
or locally in just one by setting git config variable
"status.branch" to true. The command "git status --short"
will then print a header with branch tracking information
- i.e. always print something.
With such a git config, the stashAndUpdate always stashes.
The "git stash push" command for a clean tree succeeds by doing nothing.
Then "git stash pop" command fails because there is nothing to pop.
Diff Detail
- Repository
- R365 kdesrc-build
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Thanks! This is a much better way to implement this, even if I had found git-diff-index in my search when I was implementing this I'm sure I would have missed the --quiet and --exit-code cmdline options that make this a simple check. Please let me know if you're not able to commit and I will do so instead.
Hoy! Sorry for the delay. I do not have commit access - please land the commit when you have the time. Thanks!