Comparing version 0.2.0 to 0.3.0
@@ -611,16 +611,2 @@ "use strict"; | ||
} | ||
function switchBranch(branchName, state) { | ||
const statusResult = gitCommand('status', ['--porcelain']); | ||
const statusDirty = statusResult.stdout.length > 0; | ||
if (!statusDirty) { | ||
return gitSwitch([branchName]); | ||
} | ||
const results = chainGitCommands(() => gitCommand('stash', ['--include-untracked']), () => gitSwitch([branchName]), () => gitCommand('stash', ['apply'])); | ||
const compoundResult = compoundGitCommandsResult(results); | ||
compoundResult.message = [ | ||
`There are uncommitted changes. Will stash them and apply to ${bold(branchName)} after switch.`, | ||
'' | ||
].concat(compoundResult.message); | ||
return compoundResult; | ||
} | ||
function switchToListItem(item) { | ||
@@ -634,3 +620,3 @@ const branchName = getBranchNameForLine(item); | ||
} | ||
const { status, message } = switchBranch(branchName, state); | ||
const { status, message } = gitSwitch([branchName]); | ||
state.scene = Scene.Message; | ||
@@ -637,0 +623,0 @@ state.message = message; |
{ | ||
"name": "git-jump", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "Git Branches Helper", | ||
@@ -5,0 +5,0 @@ "scripts": { |
42457
959