Merge branch 'sg/split-index-racefix'
authorJunio C Hamano <gitster@pobox.com>
Fri, 26 Oct 2018 05:22:10 +0000 (14:22 +0900)
committerJunio C Hamano <gitster@pobox.com>
Fri, 26 Oct 2018 05:22:10 +0000 (14:22 +0900)
The codepath to support the experimental split-index mode had
remaining "racily clean" issues fixed.

* sg/split-index-racefix:
split-index: BUG() when cache entry refers to non-existing shared entry
split-index: smudge and add racily clean cache entries to split index
split-index: don't compare cached data of entries already marked for split index
split-index: count the number of deleted entries
t1700-split-index: date back files to avoid racy situations
split-index: add tests to demonstrate the racy split index problem
t1700-split-index: document why FSMONITOR is disabled in this test script

1  2 
cache.h
read-cache.c
t/t1700-split-index.sh
diff --cc cache.h
Simple merge
diff --cc read-cache.c
Simple merge
index 3e618cad120f9cf692a1bc90d27d9c7ddb570135,ae74d2664a4cb490028ba88ca97f07957629ba9a..2ac47aa0e4a7164cd06037496832a1744990a774
@@@ -6,13 -6,18 +6,20 @@@ test_description='split index mode test
  
  # We need total control of index splitting here
  sane_unset GIT_TEST_SPLIT_INDEX
 -# A couple of tests expect the index to have a specific checksum,
 -# but the presence of the optional FSMN extension would interfere
 -# with those checks, so disable it in this test script.
 -sane_unset GIT_FSMONITOR_TEST
 +
 +# Testing a hard coded SHA against an index with an extension
 +# that can vary from run to run is problematic so we disable
 +# those extensions.
 +sane_unset GIT_TEST_FSMONITOR
 +sane_unset GIT_TEST_INDEX_THREADS
  
+ # Create a file named as $1 with content read from stdin.
+ # Set the file's mtime to a few seconds in the past to avoid racy situations.
+ create_non_racy_file () {
+       cat >"$1" &&
+       test-tool chmtime =-5 "$1"
+ }
  test_expect_success 'enable split index' '
        git config splitIndex.maxPercentChange 100 &&
        git update-index --split-index &&