diff options
author | Julien Stephan <jstephan@baylibre.com> | 2024-04-10 09:06:47 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-04-12 17:26:40 +0100 |
commit | d9c686b5ff9f591ec6b928ed539084c02df4c8a5 (patch) | |
tree | 565809477036779f3984f43f3c69ce9d87a77339 /scripts | |
parent | c3568ee00d3b7f6b421020dfec8005a27c2e9164 (diff) | |
download | openembedded-core-contrib-d9c686b5ff9f591ec6b928ed539084c02df4c8a5.tar.gz |
devtool: standard: throws appropriate error if source is in detached HEAD
If source is in detached HEAD, we get the following error when using
detvool finish command:
[...]
File "<...>/poky/scripts/lib/devtool/standard.py", line 1938, in _update_recipe
bb.process.run('git checkout %s' % startbranch, cwd=srctree)
File "<...>/poky/bitbake/lib/bb/process.py", line 189, in run
raise ExecutionError(cmd, pipe.returncode, stdout, stderr)
bb.process.ExecutionError: Execution of 'git checkout (HEAD detached at 9bbf87e)' failed with exit code 2:
/bin/sh: -c: line 1: syntax error near unexpected token `('
/bin/sh: -c: line 1: `git checkout (HEAD detached at 9bbf87e)'
Check this and throws an appropriate error in this case
Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/devtool/standard.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 7972b4f822..6674e67267 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py @@ -1885,6 +1885,8 @@ def _update_recipe(recipename, workspace, rd, mode, appendlayerdir, wildcard_ver for line in stdout.splitlines(): branchname = line[2:] if line.startswith('* '): + if 'HEAD' in line: + raise DevtoolError('Detached HEAD - please check out a branch, e.g., "devtool"') startbranch = branchname if branchname.startswith(override_branch_prefix): override_branches.append(branchname) |