File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -39,12 +39,11 @@ def main():
3939 del sys.argv[1]
4040 if cmd == "--version":
4141 print("Switch model version " + switch_model.__version__)
42- try:
43- from switch_model.utilities import get_git_branch
42+ from switch_model.utilities import get_git_branch
4443
45- print(f"Switch git branch { get_git_branch()}" )
46- except :
47- pass
44+ branch = get_git_branch()
45+ if branch is not None :
46+ print(f"Switch Git branch: {branch}")
4847 return 0
4948 if cmd == "solve":
5049 from switch_model.solve import main
Original file line number Diff line number Diff line change @@ -981,7 +981,6 @@ def run_command(command):
981981 )
982982
983983
984-
985984@catch_exceptions("Failed to get Git Branch.")
986985def get_git_branch():
987986 return run_command("git rev-parse --abbrev-ref HEAD")
You can’t perform that action at this time.
0 commit comments