-
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.
sha1_file: do not add own object directory as alternate
When adding alternate object directories, we try not to add the directory of the current repository to avoid cycles. Unfortunately, that test was broken, since it compared an absolute with a relative path. Signed-off-by: Ephrim Khong <dr.khong@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
- Loading branch information
Ephrim Khong
authored and
Junio C Hamano
committed
Jul 15, 2014
1 parent
45067fc
commit 539e750
Showing
2 changed files
with
33 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/sh | ||
# | ||
# Copyright (c) 2014 Ephrim Khong | ||
# | ||
|
||
test_description='repack involving cyclic alternate' | ||
. ./test-lib.sh | ||
|
||
test_expect_success setup ' | ||
GIT_OBJECT_DIRECTORY=.git//../.git/objects && | ||
export GIT_OBJECT_DIRECTORY && | ||
touch a && | ||
git add a && | ||
git commit -m 1 && | ||
git repack -adl && | ||
echo "$(pwd)"/.git/objects/../objects >.git/objects/info/alternates | ||
' | ||
|
||
test_expect_success 're-packing repository with itsself as alternate' ' | ||
git repack -adl && | ||
git fsck | ||
' | ||
|
||
test_done |