summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2019-02-25 09:26:42 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-03-27 23:21:32 +0000
commit633e024f5d492ba38debf745b59813f6a2f4a3f0 (patch)
tree58f913daf1ed74ae007e731807d19df6c2406c49
parentece8242187558011940d7c6762b64c7116e38689 (diff)
downloadopenembedded-core-contrib-633e024f5d492ba38debf745b59813f6a2f4a3f0.tar.gz
openembedded-core-contrib-633e024f5d492ba38debf745b59813f6a2f4a3f0.tar.bz2
openembedded-core-contrib-633e024f5d492ba38debf745b59813f6a2f4a3f0.zip
oeqa/utils/gitarchive: Handle case where parent is only on origin
The parent code currently assumed that any parent branch is locally checked out which may not be the case. Use the local branch by default but fall back to the origin. This also means removing the later saftey check as the branch may not exist locally. This fixes the autobuilder resulttool test pushing code. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/utils/gitarchive.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/lib/oeqa/utils/gitarchive.py b/meta/lib/oeqa/utils/gitarchive.py
index ff614d06bb..9520b2e126 100644
--- a/meta/lib/oeqa/utils/gitarchive.py
+++ b/meta/lib/oeqa/utils/gitarchive.py
@@ -80,6 +80,8 @@ def git_commit_data(repo, data_dir, branch, message, exclude, notes, log):
# Create new commit object from the tree
parent = repo.rev_parse(branch)
+ if not parent:
+ parent = repo.rev_parse("origin/" + branch)
git_cmd = ['commit-tree', tree, '-m', message]
if parent:
git_cmd += ['-p', parent]
@@ -93,8 +95,6 @@ def git_commit_data(repo, data_dir, branch, message, exclude, notes, log):
# Update branch head
git_cmd = ['update-ref', 'refs/heads/' + branch, commit]
- if parent:
- git_cmd.append(parent)
repo.run_cmd(git_cmd)
# Update current HEAD, if we're on branch 'branch'