Skip to content

Discrepancy in Git directory downloaded from the vault

Hello,

I noticed a discrepancy between what we get at https://archive.softwareheritage.org/api/1/vault/flat/swh:1:dir:b3fd64a700d509c763b0773fc2ac8d7787350c58/ and the original directory as fetched with Git from https://github.com/uds-psl/autosubst, commit fa6ef30664511ffa659cbcf3c962715cbee03572:

$ diff -r --no-dereference /gnu/store/riswg5ysmvy4kjzbzqd0qyymnsdyzabl-coq-autosubst-1-coq86-devel.fa6ef30-checkout /tmp/coq-autosubst-from-swh/
File /gnu/store/riswg5ysmvy4kjzbzqd0qyymnsdyzabl-coq-autosubst-1-coq86-devel.fa6ef30-checkout/coqdocjs is a directory while file /tmp/coq-autosubst-from-swh/coqdocjs is a symbolic link

As it turns out, coqdocjs is an empty directory in Git:

$ ls -ld /tmp/coq-autosubst-from-swh/coqdocjs /gnu/store/riswg5ysmvy4kjzbzqd0qyymnsdyzabl-coq-autosubst-1-coq86-devel.fa6ef30-checkout/coqdocjs
dr-xr-xr-x 2 root root  4096 Jan  1  1970 /gnu/store/riswg5ysmvy4kjzbzqd0qyymnsdyzabl-coq-autosubst-1-coq86-devel.fa6ef30-checkout/coqdocjs/
lrwxrwxrwx 1 ludo users   40 Sep  9 21:43 /tmp/coq-autosubst-from-swh/coqdocjs -> 9f189a3a35e6dbd3d90662b9fdc5abe90f821000
$ ls -l  /gnu/store/riswg5ysmvy4kjzbzqd0qyymnsdyzabl-coq-autosubst-1-coq86-devel.fa6ef30-checkout/coqdocjs
total 0

I vaguely recall empty directories were treated differently in the SWH model, but I wasn't sure whether this was expected behavior or if it could be worked around.

Thoughts?