mirror of
https://git.yoctoproject.org/poky
synced 2026-01-29 21:08:42 +01:00
patchtest: apply patch in repo root
Patchtest tries to apply the received patch on the repository, without specifying the directory, which means that the CWD is used. In case the patch modifies a content in a different folder (e.g. the script is running in ./meta, but the patch modifies ./meta-selftest), the patch will be skipped, but git still returns 0, instead of complaining. To avoid such false positives, specify the working directory for applying the patch - the top of the repodir. (From OE-Core rev: 6c7bb23b05ab613d5efe8e1378d7e1b1cc8cfc45) Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
4ea7a1d0cb
commit
a690cfb9c0
@@ -52,7 +52,7 @@ class PatchTestRepo(object):
|
||||
self._patchcanbemerged = True
|
||||
try:
|
||||
# Make sure to get the absolute path of the file
|
||||
self.repo.git.execute(['git', 'apply', '--check', os.path.abspath(self.patch.path)], with_exceptions=True)
|
||||
self.repo.git.execute(['git', '-C', self.repodir, 'apply', '--check', os.path.abspath(self.patch.path)], with_exceptions=True)
|
||||
except git.exc.GitCommandError as ce:
|
||||
self._patchcanbemerged = False
|
||||
|
||||
@@ -76,7 +76,7 @@ class PatchTestRepo(object):
|
||||
|
||||
def merge(self):
|
||||
if self._patchcanbemerged:
|
||||
self.repo.git.execute(['git', 'am', '--keep-cr', os.path.abspath(self.patch.path)])
|
||||
self.repo.git.execute(['git', '-C', self.repodir, 'am', '--keep-cr', os.path.abspath(self.patch.path)])
|
||||
self._patchmerged = True
|
||||
|
||||
def clean(self):
|
||||
|
||||
Reference in New Issue
Block a user