diff options
author | George Burgess IV <gbiv@google.com> | 2024-05-06 18:10:33 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2024-05-08 17:43:46 +0000 |
commit | e7959711a881a7beac5462e899a09e3566b61c6e (patch) | |
tree | 56746d4d88523b204d0cb52a9d8072cff0b7a5ce | |
parent | c7b23971afb305381029254c9de844bd153e7851 (diff) | |
download | toolchain-utils-e7959711a881a7beac5462e899a09e3566b61c6e.tar.gz |
afdo_tools: use git_utils instead of custom function
BUG=b:319460882
TEST=repo upload
Change-Id: I6d941e9439c932b1d0364c04b46ecd57d8408968
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/5515908
Tested-by: George Burgess <gbiv@chromium.org>
Reviewed-by: Jordan Abrahams-Whitehead <ajordanr@google.com>
Commit-Queue: Jordan Abrahams-Whitehead <ajordanr@google.com>
Auto-Submit: George Burgess <gbiv@chromium.org>
-rw-r--r-- | afdo_tools/update_kernel_afdo.py | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/afdo_tools/update_kernel_afdo.py b/afdo_tools/update_kernel_afdo.py index 63227c23..c4bc2bd5 100644 --- a/afdo_tools/update_kernel_afdo.py +++ b/afdo_tools/update_kernel_afdo.py @@ -203,17 +203,6 @@ def git_fetch(git_dir: Path) -> None: ) -def git_rev_parse(git_dir: Path, ref_or_sha: str) -> str: - return subprocess.run( - ["git", "rev-parse", ref_or_sha], - check=True, - cwd=git_dir, - stdin=subprocess.DEVNULL, - stdout=subprocess.PIPE, - encoding="utf-8", - ).stdout.strip() - - def autodetect_branches(toolchain_utils: Path) -> Dict[Channel, GitBranch]: """Returns GitBranches for each branch type in toolchain_utils.""" stdout = subprocess.run( @@ -794,7 +783,7 @@ def main(argv: List[str]) -> None: logging.info( "--upload not specified. Leaving commit for %s at %s", channel, - git_rev_parse(worktree, "HEAD"), + git_utils.resolve_ref(worktree, "HEAD"), ) if had_failures: |