From a93855e1a639287d2fbb3c120775711c75fecd07 Mon Sep 17 00:00:00 2001 From: Capybara-z Date: Fri, 13 Jun 2025 22:54:25 +0300 Subject: [PATCH] fix: correct version check to compare against current branch --- bot.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 13334c64..47a55418 100644 --- a/bot.py +++ b/bot.py @@ -23,6 +23,10 @@ def get_git_commit_number() -> str: repo_url = "https://github.com/Vladless/Solo_bot" try: + current_branch = subprocess.check_output( + ["git", "rev-parse", "--abbrev-ref", "HEAD"] + ).decode().strip() + local_number = subprocess.check_output( ["git", "rev-list", "--count", "HEAD"] ).decode().strip() @@ -35,7 +39,7 @@ def get_git_commit_number() -> str: try: remote_commit = subprocess.check_output( - ["git", "ls-remote", "origin", "refs/heads/dev"] + ["git", "ls-remote", "origin", f"refs/heads/{current_branch}"] ).decode() remote_hash = remote_commit.split()[0]