os-release: ensure 'dirty' really means dirty.
When using --git-dir, git no longer automatically determines the
working tree and thus always assumes the tree is dirty unless the
--work-tree option is also passed.
Fixes openbmc/openbmc#820.
Change-Id: I3af6941e0562bf665290e57c2b7a80459385fefa
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/meta-phosphor/common/recipes-core/os-release/os-release.bbappend b/meta-phosphor/common/recipes-core/os-release/os-release.bbappend
index d91823d..1ac195f 100644
--- a/meta-phosphor/common/recipes-core/os-release/os-release.bbappend
+++ b/meta-phosphor/common/recipes-core/os-release/os-release.bbappend
@@ -1,7 +1,8 @@
def run_git(d, cmd):
try:
oeroot = d.getVar('COREBASE', True)
- return bb.process.run("git --git-dir %s/.git %s" %(oeroot, cmd))[0].strip('\n')
+ return bb.process.run("git --work-tree %s --git-dir %s/.git %s"
+ % (oeroot, oeroot, cmd))[0].strip('\n')
except:
pass