Spaces:
Sleeping
Sleeping
Update functions.py
Browse files- functions.py +5 -3
functions.py
CHANGED
@@ -108,9 +108,7 @@ def get_contributor_commits(repo_name, contributor, period,branches, updated_tok
|
|
108 |
headers = get_headers(updated_token)
|
109 |
start_date = get_start_date(period)
|
110 |
commits = []
|
111 |
-
|
112 |
-
# Assuming the repository might have multiple branches, we start by fetching branches
|
113 |
-
branches_url = f"{GITHUB_API}/repos/{repo_name}/branches"
|
114 |
try:
|
115 |
# Fetch commits for each branch
|
116 |
for branch in branches:
|
@@ -123,9 +121,13 @@ def get_contributor_commits(repo_name, contributor, period,branches, updated_tok
|
|
123 |
commits_response = requests.get(commits_url, headers=headers, params=params)
|
124 |
commits_response.raise_for_status()
|
125 |
branch_commits = commits_response.json()
|
|
|
|
|
126 |
commits.extend(branch_commits)
|
127 |
except requests.exceptions.RequestException as e:
|
128 |
print(f"Failed to fetch commits: {e}")
|
|
|
|
|
129 |
summarized_commits = [extract_commit_summary(commit) for commit in commits]
|
130 |
return summarized_commits
|
131 |
|
|
|
108 |
headers = get_headers(updated_token)
|
109 |
start_date = get_start_date(period)
|
110 |
commits = []
|
111 |
+
|
|
|
|
|
112 |
try:
|
113 |
# Fetch commits for each branch
|
114 |
for branch in branches:
|
|
|
121 |
commits_response = requests.get(commits_url, headers=headers, params=params)
|
122 |
commits_response.raise_for_status()
|
123 |
branch_commits = commits_response.json()
|
124 |
+
print("branch_commits")
|
125 |
+
print(branch_commits)
|
126 |
commits.extend(branch_commits)
|
127 |
except requests.exceptions.RequestException as e:
|
128 |
print(f"Failed to fetch commits: {e}")
|
129 |
+
print("commits")
|
130 |
+
print(commits)
|
131 |
summarized_commits = [extract_commit_summary(commit) for commit in commits]
|
132 |
return summarized_commits
|
133 |
|