repos: add --whitespace=nowarn to git apply command

Patches contain tailing white space in empty lines around a change, those
are generally expected by git-apply and cause no issue.

However in cases where a patch file is added, removed or modified
in a patch, that patch would necessarily include `- ` or `+ ` lines,
since they operate on patch files.

Applying those patches with git-apply will cause git to print out
warnings about tailing white spaces per default, but still applies the
patch. Those warnings will be picked up by kas, and since they are
coming from stderr, print them out as `ERRORS`.

To solve this add `--whitespace=nowarn` as a parameter to the git-apply
call to silence those warnings.

In case of kas, it is to be expected that patches are added, removed or
changed in meta layers, so those supposedly errors will cause confusion.

Signed-off-by: Claudius Heine <ch@denx.de>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Claudius Heine 2022-05-12 14:12:50 +02:00 committed by Jan Kiszka
parent be4501b872
commit 42e83cb7a3

View File

@ -393,7 +393,7 @@ class GitRepo(RepoImpl):
format(refspec=self.remove_ref_prefix(self.refspec))]
def apply_patches_file_cmd(self, path):
return ['git', 'apply', path]
return ['git', 'apply', '--whitespace=nowarn', path]
def set_remote_url_cmd(self):
return ['git', 'remote', 'set-url', 'origin', self.effective_url]