-
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.
Add core.symlinks to mark filesystems that do not support symbolic li…
…nks. Some file systems that can host git repositories and their working copies do not support symbolic links. But then if the repository contains a symbolic link, it is impossible to check out the working copy. This patch enables partial support of symbolic links so that it is possible to check out a working copy on such a file system. A new flag core.symlinks (which is true by default) can be set to false to indicate that the filesystem does not support symbolic links. In this case, symbolic links that exist in the trees are checked out as small plain files, and checking in modifications of these files preserve the symlink property in the database (as long as an entry exists in the index). Of course, this does not magically make symbolic links work on such defective file systems; hence, this solution does not help if the working copy relies on that an entry is a real symbolic link. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <junkio@cox.net>
- Loading branch information
Johannes Sixt
authored and
Junio C Hamano
committed
Mar 3, 2007
1 parent
4808bec
commit 78a8d64
Showing
12 changed files
with
101 additions
and
12 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
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,28 @@ | ||
#!/bin/sh | ||
# | ||
# Copyright (c) 2007 Johannes Sixt | ||
# | ||
|
||
test_description='git-checkout-index on filesystem w/o symlinks test. | ||
This tests that git-checkout-index creates a symbolic link as a plain | ||
file if core.symlinks is false.' | ||
|
||
. ./test-lib.sh | ||
|
||
test_expect_success \ | ||
'preparation' ' | ||
git-config core.symlinks false && | ||
l=$(echo -n file | git-hash-object -t blob -w --stdin) && | ||
echo "120000 $l symlink" | git-update-index --index-info' | ||
|
||
test_expect_success \ | ||
'the checked-out symlink must be a file' ' | ||
git-checkout-index symlink && | ||
test -f symlink' | ||
|
||
test_expect_success \ | ||
'the file must be the blob we added during the setup' ' | ||
test "$(git-hash-object -t blob symlink)" = $l' | ||
|
||
test_done |
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,31 @@ | ||
#!/bin/sh | ||
# | ||
# Copyright (c) 2007 Johannes Sixt | ||
# | ||
|
||
test_description='git-update-index on filesystem w/o symlinks test. | ||
This tests that git-update-index keeps the symbolic link property | ||
even if a plain file is in the working tree if core.symlinks is false.' | ||
|
||
. ./test-lib.sh | ||
|
||
test_expect_success \ | ||
'preparation' ' | ||
git-config core.symlinks false && | ||
l=$(echo -n file | git-hash-object -t blob -w --stdin) && | ||
echo "120000 $l symlink" | git-update-index --index-info' | ||
|
||
test_expect_success \ | ||
'modify the symbolic link' ' | ||
echo -n new-file > symlink && | ||
git-update-index symlink' | ||
|
||
test_expect_success \ | ||
'the index entry must still be a symbolic link' ' | ||
case "`git-ls-files --stage --cached symlink`" in | ||
120000" "*symlink) echo ok;; | ||
*) echo fail; git-ls-files --stage --cached symlink; (exit 1);; | ||
esac' | ||
|
||
test_done |