mirror of
https://github.com/cmderdev/cmder.git
synced 2025-11-08 21:29:02 +08:00
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).
This commit is contained in:
8
vendor/clink.lua
vendored
8
vendor/clink.lua
vendored
@@ -598,12 +598,8 @@ local function hg_prompt_filter()
|
||||
|
||||
local hg_dir = get_hg_dir()
|
||||
if hg_dir then
|
||||
local output = get_hg_branch() or ""
|
||||
|
||||
-- strip the trailing spaces and newline from the branch name
|
||||
local branch = output:gsub("%s+$", "")
|
||||
|
||||
if branch ~= nil and
|
||||
local branch = get_hg_branch()
|
||||
if branch and
|
||||
string.sub(branch,1,7) ~= "abort: " and -- not an HG working copy
|
||||
(not string.find(branch, "is not recognized")) then -- 'hg' not in path
|
||||
-- If in a different repo or branch than last time, discard cached info
|
||||
|
||||
Reference in New Issue
Block a user