Skip to content

Commit 7ea6852

Browse files
author
Michelle Tilley
committed
Correctly set branch text to DETACHED HEAD when using special commit refspecs
1 parent ebf2807 commit 7ea6852

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

js/historyview.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,9 @@ define(['d3'], function () {
941941
previousHead.classed('checked-out', false);
942942
}
943943

944-
this._setCurrentBranch(ref === commit.id ? null : ref);
944+
var startsWithCommit = commit.id.indexOf(ref) === 0
945+
var startsWithHead = ref.toLowerCase().indexOf('head') === 0
946+
this._setCurrentBranch(startsWithCommit || startsWithHead ? null : ref);
945947
this.moveTag('HEAD', commit.id);
946948
this.renderTags();
947949

0 commit comments

Comments
 (0)