Skip to content

Commit

Permalink
expose branch name
Browse files Browse the repository at this point in the history
  • Loading branch information
smn committed May 19, 2015
1 parent 1c9c8b5 commit 8a04cf3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion unicore/distribute/api/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,12 @@ def test_format_repo(self):
formatted = format_repo(self.workspace.repo)
self.assertEqual(
set(formatted.keys()),
set(['name', 'commit', 'timestamp', 'author', 'schemas']))
set(['name',
'commit',
'timestamp',
'author',
'schemas',
'branch']))
last_commit = self.workspace.repo.commit()
self.assertEqual(formatted['commit'], last_commit.hexsha)
self.assertEqual(
Expand Down
1 change: 1 addition & 0 deletions unicore/distribute/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def format_repo(repo):
commit = repo.commit()
return {
'name': os.path.basename(repo.working_dir),
'branch': repo.active_branch.name,
'commit': commit.hexsha,
'timestamp': datetime.fromtimestamp(
commit.committed_date).isoformat(),
Expand Down

0 comments on commit 8a04cf3

Please sign in to comment.