Git Gateway can't commit to branches with special chars
- Dominant language
- JavaScript
- Stars
- 19.4k
- Forks
- 3.1k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 9
Description
---------------------------------------------------
BUG REPORT INFORMATION
---------------------------------------------------
**- Do you want to request a *feature* or report a *bug*?**
bug
**- What is the current behavior?**
Similar to #222, I cannot save changes to content when working on a branch with characters like "/" and "#" in its name. For instance, I can commit to https://github.com/Quicksaver/one-click-hugo-cms, but if I try to edit something in branch https://github.com/Quicksaver/one-click-hugo-cms/tree/foo/%23bar and save, it will error with "Failed to persist entry: API_ERROR: Branch not found".
The `/.netlify/git/github/branches` endpoint does list the branch correctly, so it seems like it's a problem when trying to fetch it as `/.netlify/git/github/branches/foo%2F%23bar`, returning a 404 in the latter case.
**- If the current behavior is a bug, please provide the steps to reproduce.**
- Follow the steps at https://github.com/netlify-templates/one-click-hugo-cms to deploy a ready-to-use build
- In Netlify's settings - deploys - continuous deploys, set "branch deploys" to "deploy all branches"
- Browse to your repo and create a `foo/#bar` branch from master
- Edit `site/static/admin/config.yml` to specify the backend branch with `branch: foo/#bar` like so: https://github.com/Quicksaver/one-click-hugo-cms/blob/foo/%23bar/site/static/admin/config.yml
- Once Netlify is done building that branch, login to its `/admin` and try editing and save any content.
**- What is the expected behavior?**
It should save just as well as it does for the master branch.
**- Please mention your CMS, node.js, and operating system version.**
CMS 1.0.2 and 1.0.3.
Contributor guide
Assessment
This issue has not been assessed yet.