mirror of
https://github.com/cmderdev/cmder.git
synced 2025-03-13 06:04:36 +08:00
Replace --no-lock-index with the new --no-optional-locks
This commit is contained in:
parent
1c02c55c2f
commit
29c5e83975
23
vendor/clink.lua
vendored
23
vendor/clink.lua
vendored
@ -18,7 +18,7 @@ dofile(clink_lua_file)
|
|||||||
-- not destroy our own prompt. It also means that started cmds (or batch files
|
-- not destroy our own prompt. It also means that started cmds (or batch files
|
||||||
-- which echo) don't get the ugly '{lamb}' shown.
|
-- which echo) don't get the ugly '{lamb}' shown.
|
||||||
---
|
---
|
||||||
function set_prompt_filter()
|
local function set_prompt_filter()
|
||||||
-- get_cwd() is differently encoded than the clink.prompt.value, so everything other than
|
-- get_cwd() is differently encoded than the clink.prompt.value, so everything other than
|
||||||
-- pure ASCII will get garbled. So try to parse the current directory from the original prompt
|
-- pure ASCII will get garbled. So try to parse the current directory from the original prompt
|
||||||
-- and only if that doesn't work, use get_cwd() directly.
|
-- and only if that doesn't work, use get_cwd() directly.
|
||||||
@ -108,7 +108,8 @@ end
|
|||||||
local function get_svn_dir(path)
|
local function get_svn_dir(path)
|
||||||
return get_dir_contains(path, '.svn')
|
return get_dir_contains(path, '.svn')
|
||||||
end
|
end
|
||||||
function get_svn_branch(svn_dir)
|
|
||||||
|
local function get_svn_branch(svn_dir)
|
||||||
for line in io.popen("svn info 2>nul"):lines() do
|
for line in io.popen("svn info 2>nul"):lines() do
|
||||||
local m = line:match("^Relative URL:")
|
local m = line:match("^Relative URL:")
|
||||||
if m then
|
if m then
|
||||||
@ -164,7 +165,7 @@ end
|
|||||||
-- Find out current branch
|
-- Find out current branch
|
||||||
-- @return {false|mercurial branch name}
|
-- @return {false|mercurial branch name}
|
||||||
---
|
---
|
||||||
function get_hg_branch()
|
local function get_hg_branch()
|
||||||
for line in io.popen("hg branch 2>nul"):lines() do
|
for line in io.popen("hg branch 2>nul"):lines() do
|
||||||
local m = line:match("(.+)$")
|
local m = line:match("(.+)$")
|
||||||
if m then
|
if m then
|
||||||
@ -179,21 +180,21 @@ end
|
|||||||
-- Get the status of working dir
|
-- Get the status of working dir
|
||||||
-- @return {bool}
|
-- @return {bool}
|
||||||
---
|
---
|
||||||
function get_hg_status()
|
local function get_hg_status()
|
||||||
for line in io.popen("hg status -0"):lines() do
|
for line in io.popen("hg status -0"):lines() do
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
function get_svn_status()
|
local function get_svn_status()
|
||||||
for line in io.popen("svn status -q"):lines() do
|
for line in io.popen("svn status -q"):lines() do
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
function hg_prompt_filter()
|
local function hg_prompt_filter()
|
||||||
|
|
||||||
-- Colors for mercurial status
|
-- Colors for mercurial status
|
||||||
local colors = {
|
local colors = {
|
||||||
@ -227,7 +228,7 @@ end
|
|||||||
-- Find out current branch
|
-- Find out current branch
|
||||||
-- @return {nil|git branch name}
|
-- @return {nil|git branch name}
|
||||||
---
|
---
|
||||||
function get_git_branch(git_dir)
|
local function get_git_branch(git_dir)
|
||||||
git_dir = git_dir or get_git_dir()
|
git_dir = git_dir or get_git_dir()
|
||||||
|
|
||||||
-- If git directory not found then we're probably outside of repo
|
-- If git directory not found then we're probably outside of repo
|
||||||
@ -248,8 +249,8 @@ end
|
|||||||
-- Get the status of working dir
|
-- Get the status of working dir
|
||||||
-- @return {bool}
|
-- @return {bool}
|
||||||
---
|
---
|
||||||
function get_git_status()
|
local function get_git_status()
|
||||||
local file = io.popen("git status --no-lock-index --porcelain 2>nul")
|
local file = io.popen("git status --no-optional-locks --porcelain 2>nul")
|
||||||
for line in file:lines() do
|
for line in file:lines() do
|
||||||
file:close()
|
file:close()
|
||||||
return false
|
return false
|
||||||
@ -258,7 +259,7 @@ function get_git_status()
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
function git_prompt_filter()
|
local function git_prompt_filter()
|
||||||
|
|
||||||
-- Colors for git status
|
-- Colors for git status
|
||||||
local colors = {
|
local colors = {
|
||||||
@ -289,7 +290,7 @@ function git_prompt_filter()
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
function svn_prompt_filter()
|
local function svn_prompt_filter()
|
||||||
-- Colors for svn status
|
-- Colors for svn status
|
||||||
local colors = {
|
local colors = {
|
||||||
clean = "\x1b[1;37;40m",
|
clean = "\x1b[1;37;40m",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user