summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/patch.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oe/patch.py')
-rw-r--r--meta/lib/oe/patch.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py
index 95b915a6ab..4ec9caed45 100644
--- a/meta/lib/oe/patch.py
+++ b/meta/lib/oe/patch.py
@@ -299,10 +299,10 @@ class GitApplyTree(PatchTree):
299 PatchTree.__init__(self, dir, d) 299 PatchTree.__init__(self, dir, d)
300 self.commituser = d.getVar('PATCH_GIT_USER_NAME') 300 self.commituser = d.getVar('PATCH_GIT_USER_NAME')
301 self.commitemail = d.getVar('PATCH_GIT_USER_EMAIL') 301 self.commitemail = d.getVar('PATCH_GIT_USER_EMAIL')
302 if not self._isInitialized(): 302 if not self._isInitialized(d):
303 self._initRepo() 303 self._initRepo()
304 304
305 def _isInitialized(self): 305 def _isInitialized(self, d):
306 cmd = "git rev-parse --show-toplevel" 306 cmd = "git rev-parse --show-toplevel"
307 try: 307 try:
308 output = runcmd(cmd.split(), self.dir).strip() 308 output = runcmd(cmd.split(), self.dir).strip()
@@ -310,8 +310,8 @@ class GitApplyTree(PatchTree):
310 ## runcmd returned non-zero which most likely means 128 310 ## runcmd returned non-zero which most likely means 128
311 ## Not a git directory 311 ## Not a git directory
312 return False 312 return False
313 ## Make sure repo is in builddir to not break top-level git repos 313 ## Make sure repo is in builddir to not break top-level git repos, or under workdir
314 return os.path.samefile(output, self.dir) 314 return os.path.samefile(output, self.dir) or oe.path.is_path_parent(d.getVar('WORKDIR'), output)
315 315
316 def _initRepo(self): 316 def _initRepo(self):
317 runcmd("git init".split(), self.dir) 317 runcmd("git init".split(), self.dir)