@@ -946,4 +946,48 @@ test_expect_success 'stale commit cannot be parsed when traversing graph' '
946946 )
947947'
948948
949+ test_expect_success ' config commitGraph.changedPaths acts like --changed-paths' '
950+ git init config-changed-paths &&
951+ (
952+ cd config-changed-paths &&
953+
954+ # commitGraph.changedPaths is not set and it should not write Bloom filters
955+ test_commit first &&
956+ GIT_PROGRESS_DELAY=0 git commit-graph write --reachable --progress 2>error &&
957+ test_grep ! "Bloom filters" error &&
958+
959+ # Set commitGraph.changedPaths to true and it should write Bloom filters
960+ test_commit second &&
961+ git config commitGraph.changedPaths true &&
962+ GIT_PROGRESS_DELAY=0 git commit-graph write --reachable --progress 2>error &&
963+ test_grep "Bloom filters" error &&
964+
965+ # Add one more config commitGraph.changedPaths as false to disable the previous true config value
966+ # It should still write Bloom filters due to existing filters
967+ test_commit third &&
968+ git config --add commitGraph.changedPaths false &&
969+ GIT_PROGRESS_DELAY=0 git commit-graph write --reachable --progress 2>error &&
970+ test_grep "Bloom filters" error &&
971+
972+ # commitGraph.changedPaths is still false and command line options should take precedence
973+ test_commit fourth &&
974+ GIT_PROGRESS_DELAY=0 git commit-graph write --no-changed-paths --reachable --progress 2>error &&
975+ test_grep ! "Bloom filters" error &&
976+ GIT_PROGRESS_DELAY=0 git commit-graph write --reachable --progress 2>error &&
977+ test_grep ! "Bloom filters" error &&
978+
979+ # commitGraph.changedPaths is all cleared and then set to false again, command line options should take precedence
980+ test_commit fifth &&
981+ git config --unset-all commitGraph.changedPaths &&
982+ git config commitGraph.changedPaths false &&
983+ GIT_PROGRESS_DELAY=0 git commit-graph write --changed-paths --reachable --progress 2>error &&
984+ test_grep "Bloom filters" error &&
985+
986+ # commitGraph.changedPaths is still false and it should write Bloom filters due to existing filters
987+ test_commit sixth &&
988+ GIT_PROGRESS_DELAY=0 git commit-graph write --reachable --progress 2>error &&
989+ test_grep "Bloom filters" error
990+ )
991+ '
992+
949993test_done
0 commit comments