Skip to content

Commit

Permalink
Merge commit '2018fe48dc047d7654fd2e815b1281a30bd7b0a1' into update_g…
Browse files Browse the repository at this point in the history
…it_fleximod
  • Loading branch information
ekluzek committed Nov 21, 2024
2 parents 4145117 + 2018fe4 commit 82d93ab
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 26 deletions.
38 changes: 21 additions & 17 deletions .lib/git-fleximod/git_fleximod/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,31 @@
import argparse
from git_fleximod import utils

__version__ = "0.9.2"
__version__ = "0.9.3"

def find_root_dir(filename=".gitmodules"):
""" finds the highest directory in tree
which contains a file called filename """
d = Path.cwd()
root = Path(d.root)
dirlist = []
dl = d
while dl != root:
dirlist.append(dl)
dl = dl.parent
dirlist.append(root)
dirlist.reverse()

for dl in dirlist:
attempt = dl / filename
if attempt.is_file():
return str(dl)
return None

try:
root = utils.execute_subprocess(["git","rev-parse", "--show-toplevel"],
output_to_caller=True ).rstrip()
except:
d = Path.cwd()
root = Path(d.root)
dirlist = []
dl = d
while dl != root:
dirlist.append(dl)
dl = dl.parent
dirlist.append(root)
dirlist.reverse()

for dl in dirlist:
attempt = dl / filename
if attempt.is_file():
return str(dl)
return None
return Path(root)

def get_parser():
description = """
Expand Down
2 changes: 1 addition & 1 deletion .lib/git-fleximod/git_fleximod/git_fleximod.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def main():
excludelist=excludelist,
)
if not gitmodules.sections():
sys.exit("No submodule components found")
sys.exit(f"No submodule components found, root_dir={root_dir}")
retval = 0
if action == "update":
submodules_update(gitmodules, root_dir, fxrequired, force)
Expand Down
2 changes: 1 addition & 1 deletion .lib/git-fleximod/git_fleximod/submodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def sparse_checkout(self):
if superroot:
gitroot = superroot.strip()
else:
gitroot = self.root_dir.strip()
gitroot = self.root_dir
# Now need to move the .git dir to the submodule location
rootdotgit = os.path.join(self.root_dir, ".git")
while os.path.isfile(rootdotgit):
Expand Down
6 changes: 3 additions & 3 deletions .lib/git-fleximod/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .lib/git-fleximod/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "git-fleximod"
version = "0.9.2"
version = "0.9.3"
description = "Extended support for git-submodule and git-sparse-checkout"
authors = ["Jim Edwards <[email protected]>"]
maintainers = ["Jim Edwards <[email protected]>"]
Expand Down
2 changes: 1 addition & 1 deletion .lib/git-fleximod/tbump.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
github_url = "https://github.com/jedwards4b/git-fleximod/"

[version]
current = "0.9.2"
current = "0.9.3"

# Example of a semver regexp.
# Make sure this matches current_version before
Expand Down
4 changes: 2 additions & 2 deletions .lib/git-fleximod/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def logger():
"submodule_name": "test_optional",
"status1" : "test_optional MPIserial_2.5.0-3-gd82ce7c is out of sync with .gitmodules MPIserial_2.4.0",
"status2" : "test_optional at tag MPIserial_2.4.0",
"status3" : "test_optional not checked out, out of sync at tag None, expected tag is MPIserial_2.4.0 (optional)",
"status3" : "test_optional not checked out, out of sync at tag MPIserial_2.5.1, expected tag is MPIserial_2.4.0 (optional)",
"status4" : "test_optional at tag MPIserial_2.4.0",
"gitmodules_content": """
[submodule "test_optional"]
Expand All @@ -46,7 +46,7 @@ def logger():
"submodule_name": "test_alwaysoptional",
"status1" : "test_alwaysoptional MPIserial_2.3.0 is out of sync with .gitmodules e5cf35c",
"status2" : "test_alwaysoptional at hash e5cf35c",
"status3" : "out of sync at tag None, expected tag is e5cf35c",
"status3" : "out of sync at tag MPIserial_2.5.1, expected tag is e5cf35c",
"status4" : "test_alwaysoptional at hash e5cf35c",
"gitmodules_content": """
[submodule "test_alwaysoptional"]
Expand Down

0 comments on commit 82d93ab

Please sign in to comment.