From 570efc3e48cec305c48e14c08f5201d0c19e5a61 Mon Sep 17 00:00:00 2001 From: Max Halford Date: Thu, 30 Nov 2023 00:23:34 +0100 Subject: [PATCH] Update run.py --- lea/app/run.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lea/app/run.py b/lea/app/run.py index 24b677f..478c62c 100644 --- a/lea/app/run.py +++ b/lea/app/run.py @@ -69,11 +69,15 @@ def _expand_select(select): ancestors = m.group("ancestors") == "+" descendants = m.group("descendants") == "+" - repo = git.Repo(".") + repo = git.Repo(".") # TODO: is using "." always correct? Probably not. + # Changes that have been committed staged_diffs = repo.index.diff( - repo.remotes.origin.refs.main.commit - ) # changes that have been committed - unstage_diffs = repo.head.commit.diff(None) # changes that have not been committed + repo.refs.main.commit + # repo.remotes.origin.refs.main.commit + ) + # Changes that have not been committed + unstage_diffs = repo.head.commit.diff(None) + for diff in staged_diffs + unstage_diffs: # We only care about changes to views # TODO: here we only check the file's location. We don't check whether the file