path: root/meta/classes/image-buildinfo.bbclass
diff options
authorAndré Draszik <>2016-11-04 10:53:33 (GMT)
committerRichard Purdie <>2016-11-15 15:19:53 (GMT)
commitba011f588b41ad50bffc5a24950b91e70140bc07 (patch)
treefb0e0ea6a808562fad83e7ea8a476c93a2e2fbbc /meta/classes/image-buildinfo.bbclass
parent4e6c5d87691ef96cb956b880c35f9a5bfeb7a309 (diff)
image-buildinfo: treat staged changes as modified branch, too
When staging changes in a layer using git add, image-buildinfo doesn't detect this as a modification, because of the way it uses git diff. Surely, merely staging, but not committing changes to git should not result in image-buildhistory assuming that the git repository hasn't been modified compared to the branch HEAD, this state should be treated similarly to modifications being unstaged. We have to use both, git diff and git diff --cached to get the desired result. (From OE-Core rev: b46906889665f6ab72bccee608276646cda50140) Signed-off-by: André Draszik <> Reported-by: Lukasz Nowak <> Reviewed-by: Lukasz Nowak <> Signed-off-by: Ross Burton <> Signed-off-by: Richard Purdie <>
Diffstat (limited to 'meta/classes/image-buildinfo.bbclass')
1 files changed, 3 insertions, 1 deletions
diff --git a/meta/classes/image-buildinfo.bbclass b/meta/classes/image-buildinfo.bbclass
index 3003f5d..da1edf7 100644
--- a/meta/classes/image-buildinfo.bbclass
+++ b/meta/classes/image-buildinfo.bbclass
@@ -28,7 +28,9 @@ def image_buildinfo_outputvars(vars, listvars, d):
28def get_layer_git_status(path): 28def get_layer_git_status(path):
29 import subprocess 29 import subprocess
30 try: 30 try:
31 subprocess.check_output("cd %s; PSEUDO_UNLOAD=1 git diff --quiet --no-ext-diff" % path, 31 subprocess.check_output("""cd %s; export PSEUDO_UNLOAD=1; set -e;
32 git diff --quiet --no-ext-diff
33 git diff --quiet --no-ext-diff --cached""" % path,
32 shell=True, 34 shell=True,
33 stderr=subprocess.STDOUT) 35 stderr=subprocess.STDOUT)
34 return "" 36 return ""