mirror of
https://github.com/cmderdev/cmder.git
synced 2024-11-10 09:49:12 +08:00
Fix git branch name never shown as dirty
The problem was that io.popen() returns a file and not the return code of the called program. The new code was inspired by http://stackoverflow.com/a/14031974/1380673
This commit is contained in:
parent
2b047e8683
commit
c19412045c
6
vendor/clink.lua
vendored
6
vendor/clink.lua
vendored
@ -193,7 +193,11 @@ end
|
||||
-- @return {bool}
|
||||
---
|
||||
function get_git_status()
|
||||
return io.popen("git diff --quiet --ignore-submodules HEAD 2>nul")
|
||||
local file = io.popen("git diff --quiet --ignore-submodules HEAD 2>nul")
|
||||
-- This will get a table with some return stuff
|
||||
-- rc[3] will be the signal, 0 or 1
|
||||
local rc = {file:close()}
|
||||
return rc[3] == 0
|
||||
end
|
||||
|
||||
function git_prompt_filter()
|
||||
|
Loading…
Reference in New Issue
Block a user