kleaf: checkpatch_presubmit: Find repo root from workspace directory

When the execution root is not under the repo root (e.g. if out/ is
linked to somewhere else), _find_repo(".") will not be able to find the
repo root. Change to find the repo root from the workspace directory
instead.

Also add _get_package_path() to make it easier to be reused.

Bug: 492248790
Change-Id: I01e7a4a6326310e50349d06209d16ddf75b570e8
Signed-off-by: Jacky Liu <[email protected]>
1 file changed