Skip to content

Commit 9a57386

Browse files
committed
working on github workflow
1 parent 94b52e1 commit 9a57386

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

CIME/gitinterface.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ def __init__(self, repo_path, logger, branch=None):
1616
minor = int(result[0][1])
1717
if major < 2 or (major == 2 and minor < 28):
1818
logger.warning(
19-
"Git not found or git version too old for cesm git interface"
19+
"Git not found or git version too old for cesm git interface {} {}".format(
20+
major, minor
21+
)
2022
)
2123
return
2224

CIME/status.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,20 @@ def append_case_status(phase, status, msg=None, caseroot=".", gitinterface=None)
3939
if gitinterface:
4040
filelist = gitinterface.git_operation(
4141
"ls-files", "--deleted", "--exclude-standard"
42-
).splitlines()
42+
)
4343
# First delete files that have been removed
44-
for f in filelist:
45-
logger.debug("removing file {}".format(f))
46-
gitinterface.git_operation("rm", f)
44+
if filelist:
45+
for f in filelist.splitlines():
46+
logger.debug("removing file {}".format(f))
47+
gitinterface.git_operation("rm", f)
4748
filelist = gitinterface.git_operation(
4849
"ls-files", "--others", "--modified", "--exclude-standard"
49-
).splitlines()
50+
)
5051
# Files that should not be added should have been excluded by the .gitignore file
51-
for f in filelist:
52-
logger.debug("adding file {}".format(f))
53-
gitinterface.git_operation("add", f)
52+
if filelist:
53+
for f in filelist.splitlines():
54+
logger.debug("adding file {}".format(f))
55+
gitinterface.git_operation("add", f)
5456
msg = msg if msg else " no message provided"
5557
gitinterface.git_operation("commit", "-m", '"' + msg + '"')
5658
remote = gitinterface.git_operation("remote")

0 commit comments

Comments
 (0)