Skip to content

Commit

Permalink
Save value for version when uncommitted changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleGower committed Feb 25, 2024
1 parent 30fe544 commit 6d7b391
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions python/lsst/sconsUtils/vcs/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ def guessVersionName():
if not os.path.exists(".git"):
state.log.warn("Cannot guess version without .git directory; version will be set to 'unknown'.")
return "unknown"
desc = utils.runExternal("git describe --tags --always", fatal=True)
desc = desc.strip()

status = utils.runExternal("git status --porcelain --untracked-files=no", fatal=True)
if status.strip():
raise RuntimeError("Error with git version: uncommitted changes")
desc = utils.runExternal("git describe --tags --always", fatal=True)
return desc.strip()
desc += " *"
return desc


def guessFingerprint():
Expand Down

0 comments on commit 6d7b391

Please sign in to comment.