git-update: Don't try to pull --rebase repos that are not on master

This fixes updating of repos that are at a specific commit and
a detached HEAD, such as openh264.
This commit is contained in:
Nirbheek Chauhan 2018-10-02 09:51:11 +05:30
parent 4525078098
commit 0f21cf4740

View file

@ -35,6 +35,13 @@ def update_subprojects(manifest, no_interaction=False):
if not os.path.exists(os.path.join(repo_dir, '.git')):
continue
revision = repos_commits.get(repo_name)
if not revision:
# If we're on a detached head because the revision= value in the
# wrap file is a commit, don't try to git pull --rebase because
# that will always fail.
ret = git('-C', repo_dir, 'rev-parse', '--symbolic-full-name', 'HEAD')
if ret.strip() == 'HEAD':
revision = git('rev-parse', 'HEAD').strip()
if not update_repo(repo_name, repo_dir, revision, no_interaction):
return False