1.10.1
release or try.gitea.io
repro with 1.11.0+dev-393-g95a57394a
2.17.1
or whatever try.gitea.io
runstry.gitea.io
runs[x]
):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\": \"[email protected]\", \"name\": \"AuthorName\" }, \"branch\": \"master\", \"committer\": { \"email\": \"[email protected]\", \"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 <[email protected]>
AuthorDate: Sun Dec 8 19:40:16 2019 +0000
Commit: AuthorName <[email protected]>
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$
good :eyes: !
-> send fix: #9297
Thanks for the quick fix, I can confirm it works fine now:
lukas@dev:~/giteabug1-repro$ git show --pretty=fuller 36f4e868dbd2d1be5f5496e00ffbd10442859ef7
commit 36f4e868dbd2d1be5f5496e00ffbd10442859ef7
Author: AuthorName <[email protected]>
AuthorDate: Mon Dec 9 14:15:53 2019 +0000
Commit: CommitterName <[email protected]>
CommitDate: Mon Dec 9 14:15:53 2019 +0000
Create a new file
Most helpful comment
Thanks for the quick fix, I can confirm it works fine now: