findmissing: Introduce local _git_check_output function

The following code sequence is used several times in the code.

	cmd = ['git', '-C', path, ...]
	result = git_check_output(cmd, encoding='utf-8', errors='ignore'[, stderr=subprocess.DEVNULL])

Move it into a local function and call it with

	cmd = [...]
	result = _git_check_output(path, cmd)

This simplifies the code, standardizes error handling, and makes it easier
to replace the underlying git access in the future.

BUG=b:177099511
TEST=Run on robot

Change-Id: Ia6a8def9012a062b6ffb1a3c496609d80ce81100
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/dev-util/+/2643076
Reviewed-by: Curtis Malainey <cujomalainey@chromium.org>
Commit-Queue: Guenter Roeck <groeck@chromium.org>
Tested-by: Guenter Roeck <groeck@chromium.org>
1 file changed