Skip to content

Commit 6ed192a

Browse files
committed
Properly handle ref_branch, default to main
1 parent 7a13fb7 commit 6ed192a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

github_activity/github_activity.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -690,9 +690,11 @@ def filter_ignored(userlist):
690690
this_md = f"- {ititle} [#{irowdata['number']}]({irowdata['url']}) ({contributor_list})"
691691
items["md"].append(this_md)
692692

693-
# Get functional GitHub references: any git reference or master@{YY-mm-dd}
693+
# Get functional GitHub references: any git reference or {branch}@{YY-mm-dd}
694+
# Use the branch parameter if provided, otherwise default to "main"
695+
ref_branch = branch or "main"
694696
if closed_prs.size > 0 and not data.since_is_git_ref:
695-
since = f"master@{{{data.since_dt:%Y-%m-%d}}}"
697+
since = f"{ref_branch}@{{{data.since_dt:%Y-%m-%d}}}"
696698
closest_date_start = closed_prs.loc[
697699
abs(
698700
pd.to_datetime(closed_prs["closedAt"], utc=True)
@@ -704,7 +706,7 @@ def filter_ignored(userlist):
704706
since_ref = since
705707

706708
if closed_prs.size > 0 and not data.until_is_git_ref:
707-
until = f"master@{{{data.until_dt:%Y-%m-%d}}}"
709+
until = f"{ref_branch}@{{{data.until_dt:%Y-%m-%d}}}"
708710
closest_date_stop = closed_prs.loc[
709711
abs(
710712
pd.to_datetime(closed_prs["closedAt"], utc=True)

0 commit comments

Comments
 (0)