Skip to content

Commit

Permalink
Fix missing commits from non-active branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Eerovil committed Apr 2, 2021
1 parent 75b5b37 commit d1f0dfa
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions tracklater/timemodules/gitmodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,16 @@ def get_entries(self) -> List[Entry]:
class Provider(AbstractProvider):
def get_log_entries(self, repo_path, start_date=None):
repo = git.Repo(repo_path)
iterator = repo.iter_commits()
for commit in iterator:
try:
if start_date and git_time_to_datetime(commit.authored_datetime) < start_date:
break
except Exception as e:
logger.warning(e)
continue
yield commit
for head in repo.heads:
iterator = repo.iter_commits(head)
for commit in iterator:
try:
if start_date and git_time_to_datetime(commit.authored_datetime) < start_date:
break
except Exception as e:
logger.warning(e)
continue
yield commit

def test_get_log_entries(self, repo_path, start_date=None):
with open(FIXTURE_DIR + '/git_test_data.json', 'r') as f:
Expand Down

0 comments on commit d1f0dfa

Please sign in to comment.