Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-05-06 00:54:28 +0300
committerJunio C Hamano <gitster@pobox.com>2020-05-06 00:54:28 +0300
commit1d7e9c4c4e60375146ad70ed5c555574a653e92a (patch)
treea7feeb931a91fcb166a508f495f125208ee90155 /t/t5318-commit-graph.sh
parentb75dc16ae3aa325941d64a3d0cfc1690a164786a (diff)
parent45a4365cb610adce1c37c099da7d18619725ce4f (diff)
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'
Diffstat (limited to 't/t5318-commit-graph.sh')
-rwxr-xr-xt/t5318-commit-graph.sh15
1 files changed, 14 insertions, 1 deletions
diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh
index 39e2918a32..424599959c 100755
--- a/t/t5318-commit-graph.sh
+++ b/t/t5318-commit-graph.sh
@@ -14,6 +14,10 @@ test_expect_success 'setup full repo' '
test_oid_init
'
+test_expect_success POSIXPERM 'tweak umask for modebit tests' '
+ umask 022
+'
+
test_expect_success 'verify graph with no graph file' '
cd "$TRASH_DIRECTORY/full" &&
git commit-graph verify
@@ -98,6 +102,13 @@ test_expect_success 'write graph' '
graph_read_expect "3"
'
+test_expect_success POSIXPERM 'write graph has correct permissions' '
+ test_path_is_file $objdir/info/commit-graph &&
+ echo "-r--r--r--" >expect &&
+ test_modebits $objdir/info/commit-graph >actual &&
+ test_cmp expect actual
+'
+
graph_git_behavior 'graph exists' full commits/3 commits/1
test_expect_success 'Add more commits' '
@@ -423,7 +434,8 @@ GRAPH_BYTE_FOOTER=$(($GRAPH_OCTOPUS_DATA_OFFSET + 4 * $NUM_OCTOPUS_EDGES))
corrupt_graph_setup() {
cd "$TRASH_DIRECTORY/full" &&
test_when_finished mv commit-graph-backup $objdir/info/commit-graph &&
- cp $objdir/info/commit-graph commit-graph-backup
+ cp $objdir/info/commit-graph commit-graph-backup &&
+ chmod u+w $objdir/info/commit-graph
}
corrupt_graph_verify() {
@@ -437,6 +449,7 @@ corrupt_graph_verify() {
fi &&
git status --short &&
GIT_TEST_COMMIT_GRAPH_DIE_ON_LOAD=true git commit-graph write &&
+ chmod u+w $objdir/info/commit-graph &&
git commit-graph verify
}