Fossil SCM

checkin/9d75d6ae887d17efcf161c549933505b9daf034de21a7629713ea90db247488e

5 years, 6 months ago by andygoth

Test procedure demonstrating the problem fixed by this commit:

mkdir test
cd 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

This is due to the stat buffer examined by file_islink(0) being for the directory containing the link, rather than the link itself. The call to file_islink(0) is preceded by a call to file_nondir_objects_on_path(), which overwrites the stat buffer. The fix is to call file_islink(0) first.

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button