forked from git/git
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
An extra worktree attached to a repository points at each other to allow finding the repository from the worktree and vice versa possible. Turn this linkage to relative paths. * cw/worktree-relative: worktree: add test for path handling in linked worktrees worktree: link worktrees with relative paths worktree: refactor infer_backlink() to use *strbuf worktree: repair copied repository and linked worktrees
- Loading branch information
Showing
8 changed files
with
312 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/sh | ||
|
||
test_description='test worktrees linked with relative paths' | ||
|
||
TEST_PASSES_SANITIZE_LEAK=true | ||
. ./test-lib.sh | ||
|
||
test_expect_success 'links worktrees with relative paths' ' | ||
test_when_finished rm -rf repo && | ||
git init repo && | ||
( | ||
cd repo && | ||
test_commit initial && | ||
git worktree add wt1 && | ||
echo "../../../wt1/.git" >expected_gitdir && | ||
cat .git/worktrees/wt1/gitdir >actual_gitdir && | ||
echo "gitdir: ../.git/worktrees/wt1" >expected_git && | ||
cat wt1/.git >actual_git && | ||
test_cmp expected_gitdir actual_gitdir && | ||
test_cmp expected_git actual_git | ||
) | ||
' | ||
|
||
test_expect_success 'move repo without breaking relative internal links' ' | ||
test_when_finished rm -rf repo moved && | ||
git init repo && | ||
( | ||
cd repo && | ||
test_commit initial && | ||
git worktree add wt1 && | ||
cd .. && | ||
mv repo moved && | ||
cd moved/wt1 && | ||
git status >out 2>err && | ||
test_must_be_empty err | ||
) | ||
' | ||
|
||
test_done |
Oops, something went wrong.