Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix git worktree #2680

Merged
merged 2 commits into from
Mar 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 6 additions & 0 deletions vendor/clink.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down