Skip to content

!version fails if you checkout a tag instead of a branch #234

@Grazfather

Description

@Grazfather
DEBUG:log:Processing message: version from C5B0PNGC9 (U16RK78GK)
2021-01-18 20:47:46,790 - bot_handler          - BotHandler::VersionCommand
Traceback (most recent call last):
  File "/src/handlers/bot_handler.py", line 40, in execute
    message = GitHandler(".").get_version()
  File "/src/util/githandler.py", line 75, in get_version
    current_branch = self.repo.refs.follow(b"HEAD")[0][1].decode().split("/")[-1]
IndexError: list index out of range
ERROR:log:BotHandler::VersionCommand
Traceback (most recent call last):
  File "/src/handlers/bot_handler.py", line 40, in execute
    message = GitHandler(".").get_version()
  File "/src/util/githandler.py", line 75, in get_version
    current_branch = self.repo.refs.follow(b"HEAD")[0][1].decode().split("/")[-1]
IndexError: list index out of range

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions