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 #30, add support for git worktrees #81

Merged
merged 1 commit into from
May 25, 2024
Merged

Fix #30, add support for git worktrees #81

merged 1 commit into from
May 25, 2024

Conversation

chase
Copy link
Contributor

@chase chase commented May 10, 2024

For git worktrees, .git is actually a file, not a directory.

I modified create_conflict.sh for testing it with worktrees:

#!/bin/bash
[ -d ./../conflict-test/ ] && rm -rf ./conflict-test/
mkdir conflict-test
cd conflict-test || exit
git init
touch conflicted.lua
git add conflicted.lua
echo "local value = 1 + 1" > conflicted.lua
git commit -am 'initial'
git checkout -b new_branch
echo "local value = 1 - 1" > conflicted.lua
git commit -am 'first commit on new_branch'
git checkout main
cat > conflicted.lua<< EOF
local value = 5 + 7
print(value)
print(string.format("value is %d", value))
EOF
git commit -am 'second commit on main'
git switch new_branch
git worktree add ../worktree-test main
(cd ../worktree-test && git merge new_branch)

@b0o
Copy link

b0o commented May 25, 2024

Thanks, this fixes the issue for me too!

Copy link
Owner

@akinsho akinsho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, sorry for the delay

@akinsho akinsho merged commit 1371080 into akinsho:main May 25, 2024
@partounian
Copy link

Awesome work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants