Skip to content

Commit e64974e

Browse files
authored
feat(docker): Support execution on repos under git worktree (antonbabenko#845)
1 parent f3c2648 commit e64974e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ wdir="$(pwd)"
3939
if ! su-exec "$USERID" "$BASHPATH" -c "test -w $wdir && test -r $wdir"; then
4040
echo_error_and_exit "uid:gid $USERID lacks permissions to $wdir/"
4141
fi
42-
wdirgitindex="$wdir/.git/index"
42+
wdirgitindex="$(git rev-parse --git-dir 2>&1)/index" || echo_error_and_exit "${wdirgitindex%/index}"
4343
if ! su-exec "$USERID" "$BASHPATH" -c "test -w $wdirgitindex && test -r $wdirgitindex"; then
4444
echo_error_and_exit "uid:gid $USERID cannot write to $wdirgitindex"
4545
fi

0 commit comments

Comments
 (0)