On Thu, Jun 22, 2017 at 10:25 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote: > Christian Couder <christian.couder@xxxxxxxxx> writes: > >> We use "git config core.sharedrepository 0666" at the beginning of >> this test, so it will only apply to the shared index files that are >> created after that. >> >> Do you suggest that we test before setting core.sharedrepository that >> the existing shared index files all have the default permissions? > > I think it would be sensible to see at least two values appear. > Otherwise we cannot tell if the right value is coming by accident > (because it was the default) or by design (because the configuration > is correctly read). Ok, I think I will use something like this then: while read -r mode modebits filename; do test_expect_success POSIXPERM "split index respects core.sharedrepository $mode" ' git config core.sharedrepository "$mode" && : >"$filename" && git update-index --add "$filename" && echo "$modebits" >expect && test_modebits .git/index >actual && test_cmp expect actual && newest_shared_index=$(ls -t .git/sharedindex.* | head -1) && test_modebits "$newest_shared_index" >actual && test_cmp expect actual ' done <<\EOF 0666 -rw-rw-rw- seventeen 0642 -rw-r---w- eightteen EOF