Spaces:
Sleeping
Sleeping
Update functions.py
Browse files- functions.py +1 -5
functions.py
CHANGED
@@ -91,7 +91,7 @@ def extract_commit_summary(commit_data):
|
|
91 |
|
92 |
return commit_summary
|
93 |
# Function to fetch commits by a contributor in a given period
|
94 |
-
def get_contributor_commits(repo_name, contributor, period, updated_token=None):
|
95 |
"""
|
96 |
Fetch all commits made by a specific contributor within a specified period for a given repository.
|
97 |
|
@@ -111,10 +111,6 @@ def get_contributor_commits(repo_name, contributor, period, updated_token=None):
|
|
111 |
# Assuming the repository might have multiple branches, we start by fetching branches
|
112 |
branches_url = f"{GITHUB_API}/repos/{repo_name}/branches"
|
113 |
try:
|
114 |
-
branches_response = requests.get(branches_url, headers=headers)
|
115 |
-
branches_response.raise_for_status()
|
116 |
-
branches = [branch['name'] for branch in branches_response.json()]
|
117 |
-
|
118 |
# Fetch commits for each branch
|
119 |
for branch in branches:
|
120 |
commits_url = f"{GITHUB_API}/repos/{repo_name}/commits"
|
|
|
91 |
|
92 |
return commit_summary
|
93 |
# Function to fetch commits by a contributor in a given period
|
94 |
+
def get_contributor_commits(repo_name, contributor, period,branches, updated_token=None):
|
95 |
"""
|
96 |
Fetch all commits made by a specific contributor within a specified period for a given repository.
|
97 |
|
|
|
111 |
# Assuming the repository might have multiple branches, we start by fetching branches
|
112 |
branches_url = f"{GITHUB_API}/repos/{repo_name}/branches"
|
113 |
try:
|
|
|
|
|
|
|
|
|
114 |
# Fetch commits for each branch
|
115 |
for branch in branches:
|
116 |
commits_url = f"{GITHUB_API}/repos/{repo_name}/commits"
|