Skip to content

Commit

Permalink
update git_utils to point to ctsm
Browse files Browse the repository at this point in the history
  • Loading branch information
negin513 committed Dec 16, 2021
1 parent 00dd1c9 commit 2b70310
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions python/ctsm/git_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import logging
import subprocess
from ctsm.path_utils import path_to_ctsm_root

logger = logging.getLogger(__name__)

Expand All @@ -10,20 +11,21 @@ def get_git_short_hash():
"""
Returns Git short SHA for the currect directory.
"""
sha = subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']).strip().decode()
sha = subprocess.check_output(['git', '-C', path_to_ctsm_root(),
'rev-parse', '--short', 'HEAD']).strip().decode()
return sha


def get_git_long_hash():
"""
Returns Git long SHA for the currect directory.
"""
sha = subprocess.check_output(["git", "rev-parse", "HEAD"]).strip().decode()
sha = subprocess.check_output(["git", '-C', path_to_ctsm_root(), "rev-parse", "HEAD"]).strip().decode()
return sha

def get_git_describe():
"""
Returns git describe output
"""
label = subprocess.check_output(["git", "describe"]).strip()
return label.decode()
label = subprocess.check_output(["git", "describe"]).strip().decode()
return label

0 comments on commit 2b70310

Please sign in to comment.