fetch: With revision as a SHA west will fetch default ref-space

This fixes an issue where west update could fail to checkout a SHA as
revision if that SHA was located on a branch that was not being
fetched.

Signed-off-by: Torsten Rasmussen <torsten.rasmussen@nordicsemi.no>
This commit is contained in:
Torsten Rasmussen 2019-02-06 17:27:29 +01:00 committed by Marti Bolivar
parent ad72d0b852
commit 6e92ce70a7
1 changed files with 2 additions and 1 deletions

View File

@ -628,7 +628,8 @@ def _fetch(project):
# --tags is required to get tags when the remote is specified as an URL.
if _is_sha(project.revision):
# Don't fetch a SHA directly, as server may restrict from doing so.
_git(project, fetch_cmd + ' --tags -- {url}')
_git(project, fetch_cmd + ' --tags -- {url} '
'refs/heads/*:refs/west/*')
_git(project, 'update-ref {qual_manifest_rev_branch} {revision}')
else:
_git(project, fetch_cmd + ' --tags -- {url} {revision}')