summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/lib/oe/patch.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py
index b838be80be..f68d40f8c8 100644
--- a/meta/lib/oe/patch.py
+++ b/meta/lib/oe/patch.py
@@ -313,9 +313,12 @@ class GitApplyTree(PatchTree):
313 return runcmd(["sh", "-c", " ".join(shellcmd)], self.dir) 313 return runcmd(["sh", "-c", " ".join(shellcmd)], self.dir)
314 314
315 # Add hooks which add a pointer to the original patch file name in the commit message 315 # Add hooks which add a pointer to the original patch file name in the commit message
316 commithook = os.path.join(self.dir, '.git', 'hooks', 'commit-msg') 316 reporoot = (runcmd("git rev-parse --show-toplevel".split(), self.dir) or '').strip()
317 if not reporoot:
318 raise Exception("Cannot get repository root for directory %s" % self.dir)
319 commithook = os.path.join(reporoot, '.git', 'hooks', 'commit-msg')
317 commithook_backup = commithook + '.devtool-orig' 320 commithook_backup = commithook + '.devtool-orig'
318 applyhook = os.path.join(self.dir, '.git', 'hooks', 'applypatch-msg') 321 applyhook = os.path.join(reporoot, '.git', 'hooks', 'applypatch-msg')
319 applyhook_backup = applyhook + '.devtool-orig' 322 applyhook_backup = applyhook + '.devtool-orig'
320 if os.path.exists(commithook): 323 if os.path.exists(commithook):
321 shutil.move(commithook, commithook_backup) 324 shutil.move(commithook, commithook_backup)