Skip to content

Commit

Permalink
fix from jim
Browse files Browse the repository at this point in the history
  • Loading branch information
Courtney Peverley committed Jul 25, 2024
1 parent d17ecdd commit 5194016
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .lib/git-fleximod/git_fleximod/submodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def status(self):
needsupdate = True
return result, needsupdate, localmods, testfails
rurl = git.git_operation("ls-remote","--get-url").rstrip()
line = git.git_operation("log", "--pretty=format:\"%h %d").partition('\n')[0]
line = git.git_operation("log", "--pretty=format:\"%h %d\"").partition('\n')[0]
parts = line.split()
ahash = parts[0][1:]
atag = None
Expand All @@ -112,12 +112,14 @@ def status(self):
while idx < len(parts)-1:
idx = idx+1
if parts[idx] == 'tag:':
atag = parts[idx+1][:-1]
atag = parts[idx+1]
while atag.endswith(')') or atag.endswith(',') or atag.endswith("\""):
atag = atag[:-1]
if atag == self.fxtag:
break


#print(f"line is {line} ahash is {ahash} atag is {atag}")
#print(f"line is {line} ahash is {ahash} atag is {atag} {parts}")
# atag = git.git_operation("describe", "--tags", "--always").rstrip()
# ahash = git.git_operation("rev-list", "HEAD").partition("\n")[0]

Expand All @@ -129,7 +131,7 @@ def status(self):
result = f" {self.name:>20} at tag {self.fxtag}"
recurse = True
testfails = False
elif self.fxtag and ahash[: len(self.fxtag)] == self.fxtag:
elif self.fxtag and (ahash[: len(self.fxtag)] == self.fxtag or (self.fxtag.find(ahash)==0)):
result = f" {self.name:>20} at hash {ahash}"
recurse = True
testfails = False
Expand All @@ -146,7 +148,7 @@ def status(self):
else:
result = f"e {self.name:>20} has no fxtag defined in .gitmodules, module at {ahash}"
testfails = False

status = git.git_operation("status", "--ignore-submodules", "-uno")
if "nothing to commit" not in status:
localmods = True
Expand Down

0 comments on commit 5194016

Please sign in to comment.