diff options
| author | Mike Frysinger <vapier@google.com> | 2026-10-23 17:13:59 -0400 |
|---|---|---|
| committer | gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2026-10-23 17:00:18 -0700 |
| commit | f4ce9572d1f9e412a5685297d2806ce410e4d4a0 (patch) | |
| tree | cb85b68a49a5ce84832ee771230b3f9be5c3434b /git_status.py | |
| parent | cc1f41d782b39d852dbd9c738ff01eb8814d9e86 (diff) | |
| download | git-repo-main.tar.gz git-repo-main.zip | |
Align with Google style guides and `import git_command` as a module
rather than import symbols out of it.
Change-Id: If80d95203e240dd6591e465ef75500c72401d2bf
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/648503
Commit-Queue: Mike Frysinger <vapier@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Tested-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'git_status.py')
| -rw-r--r-- | git_status.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/git_status.py b/git_status.py index 473ad3d5d..32c8256a3 100644 --- a/git_status.py +++ b/git_status.py @@ -18,8 +18,7 @@ from collections import OrderedDict import os from typing import Iterator, List, Optional, TYPE_CHECKING -from git_command import git_require -from git_command import GitCommand +import git_command if TYPE_CHECKING: @@ -80,7 +79,7 @@ def GetStatus( show_stash: bool = False, ) -> StatusSnapshot: """Return one machine-readable status snapshot for |project|.""" - if not git_require((2, 11, 0)): + if not git_command.git_require((2, 11, 0)): raise UnsupportedStatusError("porcelain v2 requires Git 2.11") cmd = [ "status", @@ -91,18 +90,18 @@ def GetStatus( ] if branch: cmd.append("--branch") - if git_require((2, 17, 0)): + if git_command.git_require((2, 17, 0)): cmd.append( "--ahead-behind" if ahead_behind else "--no-ahead-behind" ) - if git_require((2, 18, 0)): + if git_command.git_require((2, 18, 0)): # Match the existing staged diff's explicit rename detection even if # status.renames is disabled in the user's config. cmd.append("--renames") - if show_stash and git_require((2, 35, 0)): + if show_stash and git_command.git_require((2, 35, 0)): cmd.append("--show-stash") - p = GitCommand( + p = git_command.GitCommand( project, cmd, bare=False, |
