Thread (1 message) 1 message, 1 author, 2018-11-17

Re: [PATCH v2] read-cache: write all indexes with the same permissions

From: Junio C Hamano <hidden>
Date: 2018-11-17 08:57:27

Christian Couder [off-list ref] writes:
quoted
quoted
+test_expect_success POSIXPERM 'same mode for index & split index' '
+     git init same-mode &&
+     (
+             cd same-mode &&
+             test_commit A &&
+             test_modebits .git/index >index_mode &&
+             test_must_fail git config core.sharedRepository &&
+             git -c core.splitIndex=true status &&
+             shared=$(ls .git/sharedindex.*) &&
I think the command substitution and 'ls' are unnecessary, and

  shared=.git/sharedindex.*

would work as well.
If there is no shared index file with the above we would get:

shared=.git/sharedindex.*
$ echo $shared
.git/sharedindex.*

which seems bug prone to me.
It is not bug *PRONE*, but is already wrong, as the way this
variable is used is

        +		case "$shared" in
        +		*" "*)
        +			# we have more than one???
        +			false ;;
        +		*)
        +			test_modebits "$shared" >split_index_mode &&
        +			test_cmp index_mode split_index_mode ;;
        +		esac

i.e. we'd think there is a singleton ".git/shared/index.*" and we
can feed it to test_modebits.

So what you wrote originally is corrrect.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help