Skip to content

Commit 6e28c54

Browse files
authored
Merge pull request #149 from BenWibking/update-submodules
update submodules when doing git fetch
2 parents d1e0aef + eebd3e3 commit 6e28c54

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

repo.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,15 @@ def git_update(self):
9898

9999
shutil.copy(f"git.{self.name}.out", self.suite.full_web_dir)
100100

101+
if self.suite.updateGitSubmodules == 1:
102+
# update submodules to those specified by the current commit
103+
# (--init is required because there may be new submodules since the last checkout)
104+
self.suite.log.log(f"git submodule update in {self.dir}")
105+
_, _, rc = test_util.run(f"git submodule update --init")
106+
107+
if rc != 0:
108+
self.suite.log.fail("ERROR: git submodule update was unsuccessful")
109+
101110
def save_head(self):
102111
"""Save the current head of the repo"""
103112

suite.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ def __init__(self, args):
419419
self.useCmake = 0
420420
self.isSuperbuild = 0
421421
self.use_ctools = 1
422-
422+
423423
self.reportCoverage = args.with_coverage
424424

425425
# set automatically
@@ -435,6 +435,8 @@ def __init__(self, args):
435435
self.amrex_install_dir = "" # Cmake installation dir
436436
self.amrex_cmake_opts = ""
437437

438+
self.updateGitSubmodules = 0
439+
438440
self.MPIcommand = ""
439441
self.MPIhost = ""
440442

test_util.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
isSuperbuild = < 0: pre-build AMReX and source (default)
2929
1: CMake downloads AMReX and needs separate configure & build >
3030
31+
updateGitSubmodules = < 0: don't update submodules when changing git branches (default)
32+
1: run `git submodule update --init` after changing git branches >
33+
3134
sourceTree = < C_Src or AMReX >
3235
3336
suiteName = < descriptive name (i.e. Castro) >

0 commit comments

Comments
 (0)