Closed
Description
- Gitea version (or commit ref):
1.10.1
release ortry.gitea.io
repro with1.11.0+dev-393-g95a57394a
- Git version:
2.17.1
or whatevertry.gitea.io
runs - Operating system: Ubuntu 16.04 or whatever
try.gitea.io
runs - Database (use
[x]
):- PostgreSQL
- MySQL
- MSSQL
- SQLite
- Can you reproduce the bug at https://try.gitea.io:
- Log gist: https://gist.github.com/lukastribus/b221e2000fe25e3e08b2c9258d572bf7
Description
When using Gitea API to create or update a file and commit it, the "Author" is committed as "Commit" and vice versa.
From the log gist is obvious that not only the git repo is indicating the wrong person, but also the SQL insert is wrong. Presumably the root cause is within the API itself.
Test repository on try.gitea.io:
https://try.gitea.io/sand-giteabug1/giteabug1-repro
Request to commit a new file:
curl -X POST "https://try.gitea.io/api/v1/repos/sand-giteabug1/giteabug1-repro/contents/aNewFile" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: token <hidden>" \
-d "{ \"author\": { \"email\": \"author@example.com\", \"name\": \"AuthorName\" }, \"branch\": \"master\", \"committer\": { \"email\": \"commit@example.com\", \"name\": \"CommitterName\" }, \"content\": \"VGhpcyBpcyBhIHRlc3Q=\", \"message\": \"Create a new file\"}"
https://try.gitea.io/sand-giteabug1/giteabug1-repro/commit/011459fc45499859f1deacd02a506fdc08961a24
lukas@dev:~$ git clone https://try.gitea.io/sand-giteabug1/giteabug1-repro.git
[...]
lukas@dev:~$ cd giteabug1-repro/
lukas@dev:~/giteabug1-repro$
lukas@dev:~/giteabug1-repro$ git show --pretty=fuller
commit 011459fc45499859f1deacd02a506fdc08961a24
Author: CommitterName <commit@example.com>
AuthorDate: Sun Dec 8 19:40:16 2019 +0000
Commit: AuthorName <author@example.com>
CommitDate: Sun Dec 8 19:40:16 2019 +0000
Create a new file
diff --git a/aNewFile b/aNewFile
new file mode 100644
index 0000000..793aa68
--- /dev/null
+++ b/aNewFile
@@ -0,0 +1 @@
+This is a test
\ No newline at end of file
lukas@dev:~/giteabug1-repro$