From d4324c97343800ad2e3c00b8d6b7b036f3343f36 Mon Sep 17 00:00:00 2001 From: Mikita Pilinka Date: Mon, 27 May 2024 13:04:04 +0200 Subject: [PATCH] fix: cfbs recognizes and commits module input changes Ticket: ENT-11811 Changelog: None Signed-off-by: Mikita Pilinka --- cfbs/git.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cfbs/git.py b/cfbs/git.py index 025830ee..d8eb81a3 100644 --- a/cfbs/git.py +++ b/cfbs/git.py @@ -9,6 +9,7 @@ """ import os +import itertools import tempfile from subprocess import check_call, check_output, run, PIPE, DEVNULL, CalledProcessError @@ -189,7 +190,12 @@ def git_check_tracked_changes(scope=["all"]): else: lines = result.stdout.decode("utf-8").split("\n") changes = [line.strip().split(" ")[1] for line in lines if line] - should_commit = any(i in changes for i in scope) + should_commit = any( + map( + lambda x: os.path.samefile(*x), + list(itertools.product(changes, scope)), + ) + ) if not should_commit: print("No changes to commit") return should_commit