Skip to content

Commit

Permalink
adapt for pygit2 updates
Browse files Browse the repository at this point in the history
  • Loading branch information
AbstractUmbra committed Feb 1, 2024
1 parent 35521bb commit c8b99cd
Show file tree
Hide file tree
Showing 4 changed files with 142 additions and 212 deletions.
5 changes: 5 additions & 0 deletions .safe-gitconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[user]
name = Mipha
email = [email protected]
[safe]
directory = /app
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ services:
- ./logs/:/app/logs/:rw
- ./static/:/app/static/:rw
- ./extensions/:/app/extensions/:ro
- ./.git/:/app/.git/:ro
- ./.safe-gitconfig:/root/.gitconfig:ro

duckling:
container_name: "duckling"
Expand Down
4 changes: 2 additions & 2 deletions extensions/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,10 @@ def format_commit(self, commit: pygit2.Commit) -> str:

def get_last_commits(self, count: int = 3) -> str:
repo = pygit2.Repository(".git")
commits = list(itertools.islice(repo.walk(repo.head.target, pygit2.GIT_SORT_TOPOLOGICAL), count))
commits = list(itertools.islice(repo.walk(repo.head.target, pygit2.enums.SortMode.TOPOLOGICAL), count)) # type: ignore # not exported
return "\n".join(self.format_commit(c) for c in commits)

@commands.command(enabled=False)
@commands.command()
async def about(self, ctx: Context) -> None:
"""Tells you information about the bot itself."""

Expand Down
Loading

0 comments on commit c8b99cd

Please sign in to comment.