Skip to content

Commit

Permalink
status: also print directory
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Oct 1, 2024
1 parent 88ad799 commit 7218514
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/gitutils/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
from .status_cmd import git_status_serial, git_status_async


def git_status(path: Path, verbose: bool) -> typing.Iterator[dict]:
def git_status(path: Path, verbose: bool) -> typing.Iterator[tuple[Path, dict]]:

for d in gitdirs(path):
repo = pygit2.Repository(d)
if status := repo.status():
yield status
yield d, status


def cli():
Expand All @@ -39,7 +39,8 @@ def cli():
_log(P.verbose)

if P.method == "pygit2":
for s in git_status(P.path, P.verbose):
for d, s in git_status(P.path, P.verbose):
print(str(d))
pprint(s)
elif P.method == "serial":
for d in gitdirs(P.path):
Expand Down

0 comments on commit 7218514

Please sign in to comment.