From ca633be0e65c66f758910398b52fe96f65fd1171 Mon Sep 17 00:00:00 2001 From: Nguyen Huy Hoang <24520554@gm.uit.edu.vn> Date: Thu, 26 Mar 2026 23:17:25 +0700 Subject: [PATCH 1/2] feat: add missing `repo.tracked_files` convenience property Signed-off-by: Nguyen Huy Hoang <181364121+huyhoang171106@users.noreply.github.com> --- git/repo/base.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/git/repo/base.py b/git/repo/base.py index 16807b9fa..6d6f42b62 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -170,6 +170,11 @@ class Repo: """Subclasses may easily bring in their own custom types by placing a constructor or type here.""" + @property + def tracked_files(self) -> List[str]: + """Files currently tracked by git.""" + return self.git.ls_files().splitlines() + def __init__( self, path: Optional[PathLike] = None, From 4be3c8b2b53151b1d756ebc725f80054a0f25aee Mon Sep 17 00:00:00 2001 From: Nguyen Huy Hoang <24520554@gm.uit.edu.vn> Date: Thu, 26 Mar 2026 23:17:26 +0700 Subject: [PATCH 2/2] feat: add missing `repo.tracked_files` convenience property Signed-off-by: Nguyen Huy Hoang <181364121+huyhoang171106@users.noreply.github.com> --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 412d38205..24c75f2c2 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,8 @@ or low-level like git-plumbing. It provides abstractions of git objects for easy access of repository data often backed by calling the `git` command-line program. +For file discovery convenience, repositories expose both `Repo.untracked_files` and `Repo.tracked_files`. + ### DEVELOPMENT STATUS This project is in **maintenance mode**, which means that