Merge pull request #2680 from daxgames/fix_git_worktree

Fix git worktree
This commit is contained in:
Dax T Games 2022-03-17 08:14:08 -04:00 committed by GitHub
commit fc00cc8be2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -1,5 +1,11 @@
# Change Log
## [Unreleased](https://ci.appveyor.com/project/MartiUK/cmder/build/artifacts) (2022-03-17)
### Changes
- Fix Git prompt branch when using Git worktree.
## [1.3.19](https://github.com/cmderdev/cmder/tree/v1.3.19) (2022-01-15)
### Changes

6
vendor/clink.lua vendored
View File

@ -256,6 +256,12 @@ local function get_git_dir(path)
local git_dir = gitfile:read():match('gitdir: (.*)')
gitfile:close()
if os.isdir then -- only available in Clink v1.0.0 and higher
if git_dir and os.isdir(git_dir) then
return git_dir
end
end
return git_dir and dir..'/'..git_dir
end