From d95f5d61ba381fbef6274eae5547e08d09e1a10d Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Wed, 5 Jun 2024 14:08:19 -0600 Subject: [PATCH] fix status issue --- git_fleximod/git_fleximod.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/git_fleximod/git_fleximod.py b/git_fleximod/git_fleximod.py index 48a9b69f65..a847c9fc6b 100755 --- a/git_fleximod/git_fleximod.py +++ b/git_fleximod/git_fleximod.py @@ -298,15 +298,22 @@ def submodules_status(gitmodules, root_dir, toplevel=False): # submodule commands use path, not name url = url.replace("git@github.com:", "https://github.com/") tags = rootgit.git_operation("ls-remote", "--tags", url) + ahash = rootgit.git_operation("submodule","status",newpath).split()[0][1:] + hhash = None atag = None needsupdate += 1 if not toplevel and level: continue for htag in tags.split("\n"): - if tag and tag in htag: + if htag.endswith('^{}'): + htag = htag[:-3] + if not atag and ahash in htag: atag = (htag.split()[1])[10:] + if not hhash and htag.endswith(tag): + hhash = htag.split()[0] + if hhash and atag: break - if tag and tag == atag: + if tag and (ahash == hhash or atag == tag): print(f"e {name:>20} not checked out, aligned at tag {tag}") elif tag: ahash = rootgit.git_operation(