Skip to content

Commit

Permalink
Preserve current working folder when retrieve git hash
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryuichi Saito committed Jun 19, 2016
1 parent 4a8af09 commit 741bc5a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions oclint-scripts/oclintscripts/version.py
Expand Up @@ -6,8 +6,10 @@
from oclintscripts import path

def git_hash():
current_working_folder = os.getcwd()
os.chdir(path.root_dir)
git_hash = subprocess.check_output(['git', 'log', '-n', '1', '--pretty=%h']).split()[0]
path.cd(current_working_folder)
return git_hash

def oclint_version():
Expand Down

0 comments on commit 741bc5a

Please sign in to comment.