From 8d25b35bdaaa974469d5ece61f7316c0f6aa8180 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Thu, 9 Mar 2023 20:08:27 +0000 Subject: [PATCH] fix wrong loc - fixes #85 - fixes regression from #32 --- gitfame/_gitfame.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/gitfame/_gitfame.py b/gitfame/_gitfame.py index 7c29715..511c2c8 100755 --- a/gitfame/_gitfame.py +++ b/gitfame/_gitfame.py @@ -264,7 +264,6 @@ def stats_append(fname, auth, loc, tstamp): if churn & CHURN_SLOC: for fname in tqdm(file_list, desc=gitdir if prefix_gitdir else "Processing", disable=silent_progress, unit="file"): - if prefix_gitdir: fname = path.join(gitdir, fname) try: @@ -274,12 +273,12 @@ def stats_append(fname, auth, loc, tstamp): continue log.log(logging.NOTSET, blame_out) - # Strip boundary messages, - # preventing user with nearest commit to boundary owning the LOC - blame_out = RE_BLAME_BOUNDS.sub('', blame_out) - loc_auth_times = RE_AUTHS_BLAME.findall(blame_out) + if since: + # Strip boundary messages, + # preventing user with nearest commit to boundary owning the LOC + blame_out = RE_BLAME_BOUNDS.sub('', blame_out) - for loc, auth, tstamp in loc_auth_times: # for each chunk + for loc, auth, tstamp in RE_AUTHS_BLAME.findall(blame_out): # for each chunk loc = int(loc) stats_append(fname, auth, loc, tstamp)