From 173b86fbc8673518642ee2346763e5282d439b80 Mon Sep 17 00:00:00 2001 From: Chris Antos Date: Sun, 14 Sep 2025 10:34:23 -0700 Subject: [PATCH] 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). --- vendor/clink.lua | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/vendor/clink.lua b/vendor/clink.lua index 824c395..81b4d1e 100644 --- a/vendor/clink.lua +++ b/vendor/clink.lua @@ -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