summaryrefslogtreecommitdiff
path: root/git
diff options
context:
space:
mode:
authoryyamashita <yyamashita@hetzner.yyamashita.com>2026-11-01 09:07:19 +0900
committeryyamashita <yyamashita@hetzner.yyamashita.com>2026-11-01 09:07:19 +0900
commit689b4f4a706746f481555b9a64ff20b33b8e5a75 (patch)
tree94acb84edfe5c5341cc9f89ab6ba18613f300d09 /git
parentd4879b61af5f93c6d4a6f37939c4508ccc2811ec (diff)
git: studio-slots のフックで作業ディレクトリの所有者を戻す
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'git')
-rwxr-xr-xgit/hooks/studio-slots/post-receive5
1 files changed, 4 insertions, 1 deletions
diff --git a/git/hooks/studio-slots/post-receive b/git/hooks/studio-slots/post-receive
index 71cc5fe..15bcf9b 100755
--- a/git/hooks/studio-slots/post-receive
+++ b/git/hooks/studio-slots/post-receive
@@ -1,4 +1,7 @@
#!/bin/bash
set -e
-GIT_WORK_TREE=/home/yyamashita/workspaces/repos/studio-slots git checkout -f
+WORK_TREE=/home/yyamashita/workspaces/repos/studio-slots
+GIT_WORK_TREE=$WORK_TREE git checkout -f
+# フックは root で動くので、作業ディレクトリの所有者を戻す
+chown -R yyamashita:yyamashita "$WORK_TREE"
echo "Deploy complete: studio-slots"