From: Junio C Hamano Date: Tue, 5 May 2020 21:54:28 +0000 (-0700) Subject: Merge branch 'tb/commit-graph-perm-bits' X-Git-Tag: v2.27.0-rc0~41 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1d7e9c4c4e60375146ad70ed5c555574a653e92a;p=thirdparty%2Fgit.git Merge branch 'tb/commit-graph-perm-bits' Some of the files commit-graph subsystem keeps on disk did not correctly honor the core.sharedRepository settings and some were left read-write. * tb/commit-graph-perm-bits: commit-graph.c: make 'commit-graph-chain's read-only commit-graph.c: ensure graph layers respect core.sharedRepository commit-graph.c: write non-split graphs as read-only lockfile.c: introduce 'hold_lock_file_for_update_mode' tempfile.c: introduce 'create_tempfile_mode' --- 1d7e9c4c4e60375146ad70ed5c555574a653e92a diff --cc t/t5324-split-commit-graph.sh index 594edb7307,cff5a41f48..269d0964a3 --- a/t/t5324-split-commit-graph.sh +++ b/t/t5324-split-commit-graph.sh @@@ -358,47 -355,24 +362,67 @@@ test_expect_success 'split across alter test_cmp commit-graph .git/objects/info/commit-graph ' +test_expect_success '--split=no-merge always writes an incremental' ' + test_when_finished rm -rf a b && + rm -rf $graphdir $infodir/commit-graph && + git reset --hard commits/2 && + git rev-list HEAD~1 >a && + git rev-list HEAD >b && + git commit-graph write --split --stdin-commits a && + git rev-list -1 HEAD~1 >b && + git rev-list -1 HEAD >c && + git commit-graph write --split=no-merge --stdin-commits graph-files && + test_line_count = 1 graph-files && + verify_chain_files_exist $graphdir && + graph_read_expect 2 +' + +test_expect_success ULIMIT_FILE_DESCRIPTORS 'handles file descriptor exhaustion' ' + git init ulimit && + ( + cd ulimit && + for i in $(test_seq 64) + do + test_commit $i && + test_might_fail run_with_limited_open_files git commit-graph write \ + --split=no-merge --reachable || return 1 + done + ) +' + + while read mode modebits + do + test_expect_success POSIXPERM "split commit-graph respects core.sharedrepository $mode" ' + rm -rf $graphdir $infodir/commit-graph && + git reset --hard commits/1 && + test_config core.sharedrepository "$mode" && + git commit-graph write --split --reachable && + ls $graphdir/graph-*.graph >graph-files && + test_line_count = 1 graph-files && + echo "$modebits" >expect && + test_modebits $graphdir/graph-*.graph >actual && + test_cmp expect actual && + test_modebits $graphdir/commit-graph-chain >actual && + test_cmp expect actual + ' + done <<\EOF + 0666 -r--r--r-- + 0600 -r-------- + EOF + test_done