Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Artifact ID: | 583effbd9e6f95e0ac8f22fafae303751eaecea44620e1dbcc60dfbbe46c9837 |
|---|---|
| Page Name: | checkin/9d75d6ae887d17efcf161c549933505b9daf034de21a7629713ea90db247488e |
| Date: | 2020-09-15 19:32:07 |
| Original User: | andygoth |
| Mimetype: | text/x-markdown |
| Next | 6de545544819567fe8fb68a539e7eef6c219c8404745b99b98f916605a63fae1 |
Content
Test procedure demonstrating the problem fixed by this commit:
mkdir test
fossil new test.fossil
fossil open test.fossil -f
fossil set allow-symlinks 1
mkdir subdir
cd subdir
ln -s xxx link
fossil addremove
fossil sql "SELECT islink FROM vfile"
fossil commit -m xxx
If the bug is not fixed, the SQL query will return "0" and the commit will fail:
ERROR: [subdir/link] is 3 bytes on disk but 0 in the repository
NOTICE: Repository version of [subdir/link] stored in [file-XXX]
working checkout does not match what would have ended up in the repository: YYY versus ZZZ
The problem is that the stat buffer examined by file_islink(0) is for the directory containing the link, rather than the link itself. This is due to it being preceded by a call to file_nondir_objects_on_path(). The fix is to call file_islink(0) first.