poky/scripts/lib/devtool
Dan Dedrick a563459ea4 devtool: improve git repo checks before check_commits logic
The check_commits logic assumes that both devtool-base and args.branch
exist in the git repo that it is operating on. In order to prevent
errors at that point it's best to first ensure that both of these refs
actually exist. If they don't both exist then the check_commits logic
should just be skipped, as it would be if the repo wasn't originally
checked out by devtool.

Previously if a user removed the args.branch branch from their devtool
cloned repo this code would crash on adding the repo with -n. The crash
would look like this:

Traceback (most recent call last):
  File "/home/ddedrick/src/poky/scripts/devtool", line 344, in <module>
    ret = main()
  File "/home/ddedrick/src/poky/scripts/devtool", line 331, in main
    ret = args.func(args, config, basepath, workspace)
  File "/home/ddedrick/src/poky/scripts/lib/devtool/standard.py", line 812, in modify
    (stdout, _) = bb.process.run('git log devtool-base..%s' % branch, cwd=srctree)
  File "/home/ddedrick/src/poky/bitbake/lib/bb/process.py", line 178, in run
    raise ExecutionError(cmd, pipe.returncode, stdout, stderr)
bb.process.ExecutionError: Execution of 'git log devtool-base..devtool' failed with exit code 128:
fatal: ambiguous argument 'devtool-base..devtool': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

(From OE-Core rev: f13a3490fdb404bbd4c77e45b83540d6deec1358)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-22 14:35:58 +00:00
..
__init__.py devtool: set up git repos so that singletask.lock is ignored 2018-02-06 11:06:27 +00:00
build_image.py scripts: remove True option to getVar calls 2016-12-16 10:23:23 +00:00
build_sdk.py devtool: add build-sdk subcommand 2016-03-07 00:11:38 +00:00
build.py build.py: add clean option to 'devtool build' command 2018-09-10 12:13:06 +01:00
deploy.py devtool: fix target-deploy --strip 2018-11-27 22:13:11 +00:00
export.py logging: use warning instead warn 2018-07-26 13:16:40 +01:00
import.py logging: use warning instead warn 2018-07-26 13:16:40 +01:00
package.py meta/scripts: Various getVar/getVarFlag expansion parameter fixes 2017-01-09 13:39:11 +00:00
runqemu.py devtool: point runqemu to correct native bindir 2017-04-05 23:22:12 +01:00
sdk.py devtool/sdk.py: error out in case of downloading file failure 2018-05-15 10:56:48 +01:00
search.py devtool: search: tweak help text 2018-03-01 22:13:56 +00:00
standard.py devtool: improve git repo checks before check_commits logic 2019-01-22 14:35:58 +00:00
upgrade.py logging: use warning instead warn 2018-07-26 13:16:40 +01:00
utilcmds.py devtool: make find-recipe and edit-recipe always work with any recipe 2017-11-11 12:14:27 +00:00