This disables CSRF checking around the $repository->writeStatusMessage so that pushing changes over HTTP to Git repositories doesn't fail miserably.
Details
Details
- Reviewers
epriestley - Group Reviewers
Blessed Reviewers - Maniphest Tasks
- T4052: Crash when pushing content to Git repository
- Commits
- Restricted Diffusion Commit
rP3e2efaf00e57: Disable CSRF checks on Git push when updating repository.
Applied this fix and I could git push to hosted repositories again.
Diff Detail
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Comment Actions
A slightly better approach is:
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); // ... unset($unguarded);
This does the right thing if the intervening code throws an exception. I'll tweak that in the pull. Thanks!
Comment Actions
I also made a small change to populate:
'REMOTE_USER' => $viewer->getUsername(),
...since Git seemed cranky without it when I was testing the $unguarded flavor.