mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
git: fix status to use porcelain, ignore user configuration
From the git status doc: --porcelain Give the output in an easy-to-parse format for scripts. This is similar to the short output, but will remain stable across Git versions and regardless of user configuration. See below for details. User configuration can break the git module from working as expected.
This commit is contained in:
parent
eeabebdd6c
commit
885b8dc4d0
1 changed files with 1 additions and 1 deletions
|
@ -356,7 +356,7 @@ def has_local_mods(module, git_path, dest, bare):
|
||||||
if bare:
|
if bare:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
cmd = "%s status -s" % (git_path)
|
cmd = "%s status --porcelain" % (git_path)
|
||||||
rc, stdout, stderr = module.run_command(cmd, cwd=dest)
|
rc, stdout, stderr = module.run_command(cmd, cwd=dest)
|
||||||
lines = stdout.splitlines()
|
lines = stdout.splitlines()
|
||||||
lines = filter(lambda c: not re.search('^\\?\\?.*$', c), lines)
|
lines = filter(lambda c: not re.search('^\\?\\?.*$', c), lines)
|
||||||
|
|
Loading…
Reference in a new issue