Skip to content

Commit 173b86f

Browse files
committed
Fix another pre-existing bug in the hg prompt.
If the hg program is not found, then there used to be a Lua script error. I fixed that in the earlier commit in this PR. But the fix was incomplete, and the hg prompt still appended " ()" instead of not appending anything (which is how the svn prompt behaves when the svn program is not found).
1 parent 8ec4789 commit 173b86f

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

vendor/clink.lua

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -598,12 +598,8 @@ local function hg_prompt_filter()
598598

599599
local hg_dir = get_hg_dir()
600600
if hg_dir then
601-
local output = get_hg_branch() or ""
602-
603-
-- strip the trailing spaces and newline from the branch name
604-
local branch = output:gsub("%s+$", "")
605-
606-
if branch ~= nil and
601+
local branch = get_hg_branch()
602+
if branch and
607603
string.sub(branch,1,7) ~= "abort: " and -- not an HG working copy
608604
(not string.find(branch, "is not recognized")) then -- 'hg' not in path
609605
-- If in a different repo or branch than last time, discard cached info

0 commit comments

Comments
 (0)