strange behaviour with symlinks in git
r-ricci opened this issue · 1 comments
r-ricci commented
I have a git repository inside gocryptfs. After upgrading from 1.8.0 to 2.0 I noticed that sometimes git incorrectly reports symlinks as modified.
Exact steps to reproduce:
mkdir cipherdir mountpoint
gocryptfs -extpass 'echo pass' -init cipherdir
gocryptfs -extpass 'echo pass' cipherdir mountpoint
cd mountpoint
echo sometext > file
ln -s file link
git init
git add file link
git commit -m commitmsg
rm link
git restore link
git status
# the link is now marked as modified, but this is impossible
git add link
git status
# git figured out that no change happened
This doesn't happen on a regular filesystem or with gocryptfs 1.8.0.
Version: gocryptfs v2.0 without_openssl; go-fuse [vendored]; 2021-06-06 go1.16.5 linux/amd64
git version: 2.31.1
rfjakob commented
Thanks for the report! I can reproduce this. gocryptfs reports the wrong size on symlink creation:
19:05:24.583446 rx 8296: SYMLINK n2 ["link" "file"] 10b
19:05:24.583490 tx 8296: OK, {n708 g1 tE=1s tA=1s {M0120777 SZ=48 L=1 1026:1026 B0*4096 i0:171340 A 1622999124.582189 M 1622999124.582189 C 1622999124.582189}}