Skip to content

Commit 570c5e9

Browse files
committed
Tools: fix apply_ilooprm not needed on .git folders for mesonh push; prep_code add possibility to create branch at publication without pushing the new branch to server
1 parent df3440b commit 570c5e9

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎tools/src/pyphyextools/prep_code.py‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ def apply_ilooprm(directory):
171171
item_path = os.path.join(directory, item)
172172
if not os.path.isdir(item_path):
173173
continue
174+
if item == '.git':
175+
continue
174176
for root, _, files in os.walk(item_path):
175177
for f in files:
176178
fpath = os.path.join(root, f)
@@ -298,7 +300,7 @@ def prep_code(
298300

299301
# Build branch name for push
300302
branch = None
301-
if checkout_point and model and push:
303+
if checkout_point and model:
302304
branch = f'{model}{SEPARATOR}{checkout_point}'
303305

304306
# -------- WORKING DIRECTORY --------
@@ -327,7 +329,7 @@ def rm_func(path):
327329
raise RuntimeError("A repository must be set (use -h option to get help)")
328330

329331
run(['git', 'clone', repository, directory])
330-
if branch:
332+
if branch and push:
331333
result = subprocess.run(
332334
['git', 'ls-remote', '--heads', 'origin', 'SR_GPU'],
333335
capture_output=True, text=True, check=True,
@@ -415,7 +417,7 @@ def rm_func(path):
415417
raise RuntimeError("Coding norms verification failed, see messages above")
416418

417419
# -------- PUSH --------
418-
if branch:
420+
if branch and push:
419421
logging.info("commit and push")
420422
run(['git', 'add', '-A'], cwd=directory)
421423
commit_msg = (

0 commit comments

Comments
 (0)