Skip to content

Commit 60dd422

Browse files
authored
Merge pull request #52 from manics/fix-latest-tag
_get_latest_tag should use the remote repo
2 parents 6d51172 + 140190c commit 60dd422

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
@@ -207,8 +207,10 @@ def generate_activity_md(
207207
org, repo = _parse_target(target)
208208

209209
# If no since parameter is given, find the name of the latest release
210+
# using the _local_ git repostory
211+
# TODO: Check that local repo matches org/repo
210212
if since is None:
211-
since = _get_latest_tag(org, repo)
213+
since = _get_latest_tag()
212214

213215
# Grab the data according to our query
214216
data = get_activity(
@@ -554,8 +556,8 @@ def _get_datetime_from_git_ref(org, repo, ref):
554556
return dateutil.parser.parse(response.json()["commit"]["committer"]["date"])
555557

556558

557-
def _get_latest_tag(org, repo):
558-
"""Return the latest tag name for a given repository."""
559+
def _get_latest_tag():
560+
"""Return the latest tag name for a given repository by querying the local repo."""
559561
out = run("git describe --tags".split(), stdout=PIPE)
560562
tag = out.stdout.decode().rsplit("-", 2)[0]
561563
return tag

0 commit comments

Comments
 (0)