-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'jc/maint-rerere-in-workdir'
* jc/maint-rerere-in-workdir: rerere: make sure it works even in a workdir attached to a young repository
- Loading branch information
Showing
4 changed files
with
86 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/bin/sh | ||
|
||
test_description='rerere run in a workdir' | ||
. ./test-lib.sh | ||
|
||
test_expect_success SYMLINKS setup ' | ||
git config rerere.enabled true && | ||
>world && | ||
git add world && | ||
test_tick && | ||
git commit -m initial && | ||
echo hello >world && | ||
test_tick && | ||
git commit -a -m hello && | ||
git checkout -b side HEAD^ && | ||
echo goodbye >world && | ||
test_tick && | ||
git commit -a -m goodbye && | ||
git checkout master | ||
' | ||
|
||
test_expect_success SYMLINKS 'rerere in workdir' ' | ||
rm -rf .git/rr-cache && | ||
"$SHELL_PATH" "$TEST_DIRECTORY/../contrib/workdir/git-new-workdir" . work && | ||
( | ||
cd work && | ||
test_must_fail git merge side && | ||
git rerere status >actual && | ||
echo world >expect && | ||
test_cmp expect actual | ||
) | ||
' | ||
|
||
# This fails because we don't resolve relative symlink in mkdir_in_gitdir() | ||
# For the purpose of helping contrib/workdir/git-new-workdir users, we do not | ||
# have to support relative symlinks, but it might be nicer to make this work | ||
# with a relative symbolic link someday. | ||
test_expect_failure SYMLINKS 'rerere in workdir (relative)' ' | ||
rm -rf .git/rr-cache && | ||
"$SHELL_PATH" "$TEST_DIRECTORY/../contrib/workdir/git-new-workdir" . krow && | ||
( | ||
cd krow && | ||
rm -f .git/rr-cache && | ||
ln -s ../.git/rr-cache .git/rr-cache && | ||
test_must_fail git merge side && | ||
git rerere status >actual && | ||
echo world >expect && | ||
test_cmp expect actual | ||
) | ||
' | ||
|
||
test_done |