Skip to content

Commit

Permalink
Just use On branch ... before the initial commit
Browse files Browse the repository at this point in the history
In the dashboards we already show `HEAD: No commits yet.`
so it is not necessary to special-case the branch naming
here.
  • Loading branch information
kaste committed Dec 12, 2018
1 parent b805fb3 commit 4cb0ae1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/git_mixins/active_branch.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def _format_branch_status(self, branch_status, delim=None):
status = "HEAD is in a detached state."

elif initial:
status = "Initial commit on `{}`.".format(branch)
status = "On branch `{}`.".format(branch)

else:
tracking = " tracking `{}`".format(remote)
Expand Down
8 changes: 4 additions & 4 deletions tests/test_repo_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,20 +185,20 @@ def test_format_branch_status_for_statusbar(self, status_lines, expected):
),
(
"## No commits yet on master",
"Initial commit on `master`."
"On branch `master`."
),
(
"## No commits yet on master\n?? foo",
"Initial commit on `master`."
"On branch `master`."
),
# Previous versions of git instead emitted this before the initial commit
(
"## Initial commit on zoom",
"Initial commit on `zoom`."
"On branch `zoom`."
),
(
"## Initial commit on master\n?? foo",
"Initial commit on `master`."
"On branch `master`."
),
]

Expand Down

0 comments on commit 4cb0ae1

Please sign in to comment.