Git push fails for tag names containing + with InvalidObjectIdException in pre-receive callback
#3055
-
-
State changed as build OD-8248 is successful
-
OneDev
changed state to 'Closed' 4 weeks ago
Previous Value Current Value Open
Closed
| Type |
Bug
|
| Priority |
Normal
|
| Assignee | |
| Affected Versions |
<=16.5.6
|
| Labels |
No labels
|
Issue Votes (0)
Follow-up from issue #3054, reported by @sen23.
Adding @sen23, @robin, and @servicedesk to the watch list.
Summary
Pushing a Git tag or ref whose name contains
+is rejected by the server-side pre-receive hook (HTTP 500/pre-receive hook declined).Example tag:
1.0.10+16+is a valid Git ref character. Branch pushes without+work.Environment
Actual result
Client:
Server:
The pushed ref is
refs/tags/1.0.10+16, but parsing seesrefs/tags/1.0.10.Expected result
refs/tags/1.0.10+16is accepted and the tag is created on the remote.Root cause
git-receive-hookforwards hook stdin with curl-d @-(form body, not--data-urlencode). Servlet form decoding turns+into a space, so:arrives as:
GitPreReceiveCallbackthen splits on spaces and passesrefs/tags/1.0.10toObjectId.fromString(...).The same encoding applies to branch names containing
+.Reproduce