Inconsistent behavior of isClean check
For some reason !isClean() introduced in the #3 doesn't always work as expected.
Here is the output from git status and cob:
$ git status
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
$ cob
2020/07/02 15:30:59 the repository is dirty: commit all changes before running 'cob'
This fails both locally and in the CI for some repos, but doesn't fail for others.
Could this check be optional, so it could be force disabled in the CI where one doesn't care about loosing state.
@lwolf would be great if this could be fixed. Do you have a patched fork? (yes: https://github.com/lwolf/cob/commit/3e1328ecb99e373d35190ee599b6b3fdecb18853) I can't use it because of the same issue. I have some additional temp files locally, that are not part of the git tree and the tool fails, even when I specify a clean path like:
% cob --bench-args "test -run '^$' -bench . -benchmem ./routing"
2021/07/20 10:29:23 the repository is dirty: commit all changes before running 'cob'
zsh: exit 1 cob --bench-args "test -run '^$' -bench . -benchmem ./routing"
I have the same problem, it makes this code unusable.
I fix this problem by remove the check, https://github.com/knqyf263/cob/commit/145be31e9925d4df6207c51b1106a6851595a82b
I suggest changing libraries to https://github.com/go-git/go-git but It seems that there is a problem with this function :
https://github.com/go-git/go-git/issues/167 https://github.com/go-git/go-git/issues/387