Skip to content

Commit

Permalink
Change output: put tag/hash before branch name
Browse files Browse the repository at this point in the history
I feel like the tag/hash is the more important thing, so put it first
  • Loading branch information
billsacks committed Nov 24, 2020
1 parent 1028843 commit 952e44d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion manic/repository_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def _current_ref(self):
# If we're on a branch, include branch name in current ref
branch_found, branch_name = self._git_current_branch()
if branch_found:
current_ref = "{} ({})".format(branch_name, current_ref)
current_ref = "{} (branch {})".format(current_ref, branch_name)
else:
# If we still can't find a ref, return empty string. This
# can happen if we're not actually in a git repo
Expand Down
2 changes: 1 addition & 1 deletion test/test_unit_repository_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def test_ref_branch(self):
True, 'feature3')
self._repo._git_current_tag = self._git_current_tag(True, 'foo_tag')
self._repo._git_current_hash = self._git_current_hash(True, 'abc123')
expected = 'feature3 (foo_tag)'
expected = 'foo_tag (branch feature3)'
result = self._repo._current_ref()
self.assertEqual(result, expected)

Expand Down

0 comments on commit 952e44d

Please sign in to comment.