Skip to content

Commit b26259c

Browse files
committed
Checkout bug fix because of wrong parsing
1 parent cce283d commit b26259c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

model/git.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,10 @@ Git.prototype.loadBranches = function () {
220220
.map(function (line, index) {
221221
if (line.charAt(0) === '*') {
222222
self.currentBranchIndex = index;
223+
return _.trim(line.slice(2));
224+
} else {
225+
return _.trim(line);
223226
}
224-
225-
return line.slice(2);
226227
});
227228

228229
return this.branches;
@@ -235,7 +236,7 @@ Git.prototype.getCurrentBranchName = function () {
235236
Git.prototype.checkout = function (branchIndex) {
236237
var gitCommand = gitExec + ' checkout ' + this.branches[branchIndex];
237238

238-
var stdout = execSync(gitCommand, {stdio: [0, 1, 'pipe']});
239+
var stdout = execSync(gitCommand, {stdio: [0, 'pipe', 'pipe']});
239240

240241
this.currentBranchIndex = branchIndex;
241242

0 commit comments

Comments
 (0)