From ea8f028b99bb1ce864313b9ef241dbad548f9da4 Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Tue, 26 Mar 2013 19:19:58 -0400 Subject: [PATCH] Prevent making commits to remote tracking branches. --- js/historyview.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/js/historyview.js b/js/historyview.js index d93b244..983338d 100644 --- a/js/historyview.js +++ b/js/historyview.js @@ -665,15 +665,20 @@ define(['d3'], function () { }, _setCurrentBranch: function (branch) { - var display = this.svg.select('text.current-branch-display'); + var display = this.svg.select('text.current-branch-display'), + text = 'Current Branch: '; if (branch) { - display.text('Current Branch: ' + branch); - } else { - display.text('Current Branch: DETACHED HEAD'); + text += branch; + this.currentBranch = branch; + } + + if (!branch || branch.indexOf('origin/') === 0) { + text += ' (DETACHED HEAD)'; + this.currentBranch = null; } - this.currentBranch = branch; + display.text(text); }, _moveTag: function (tag, ref) {