summaryrefslogtreecommitdiffstats
path: root/meta
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-26 15:38:23 +0000
commit002cf940a7fb940e8a7443ca85906a87edda0bfe (patch)
treeea6a6733f85ab498730f3475e45fbf931f8d942d /meta
parentdf4d56b25aeeb2730e544b819f683ed0062168cd (diff)
downloadpoky-002cf940a7fb940e8a7443ca85906a87edda0bfe.tar.gz
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. (From OE-Core rev: 36624a17d382d84647c5811134fe76251fd64dc3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-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):
80 80
81 # Create new commit object from the tree 81 # Create new commit object from the tree
82 parent = repo.rev_parse(branch) 82 parent = repo.rev_parse(branch)
83 if not parent:
84 parent = repo.rev_parse("origin/" + branch)
83 git_cmd = ['commit-tree', tree, '-m', message] 85 git_cmd = ['commit-tree', tree, '-m', message]
84 if parent: 86 if parent:
85 git_cmd += ['-p', parent] 87 git_cmd += ['-p', parent]
@@ -93,8 +95,6 @@ def git_commit_data(repo, data_dir, branch, message, exclude, notes, log):
93 95
94 # Update branch head 96 # Update branch head
95 git_cmd = ['update-ref', 'refs/heads/' + branch, commit] 97 git_cmd = ['update-ref', 'refs/heads/' + branch, commit]
96 if parent:
97 git_cmd.append(parent)
98 repo.run_cmd(git_cmd) 98 repo.run_cmd(git_cmd)
99 99
100 # Update current HEAD, if we're on branch 'branch' 100 # Update current HEAD, if we're on branch 'branch'