Closed
Description
Gitea Version
1.16.1
Git Version
2.13.6
Operating System
Ubuntu server 20.04
How are you running Gitea?
Installed from binary
Database
MySQL
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
https://gist.github.com/TOMeeeek/554a4d6ed4a6336683904887c086f0e4
2022/02/11 12:53:54 ...ers/web/repo/view.go:860:renderCode() [E] GitRepo.IsEmpty: check empty: exit status 129 - usage: git rev-list [OPTION] <commit-id>... [ -->
limiting output:
--max-count=<n>
--max-age=<epoch>
--min-age=<epoch>
--sparse
--no-merges
--min-parents=<n>
--no-min-parents
--max-parents=<n>
--no-max-parents
--remove-empty
--all
--branches
--tags
--remotes
--stdin
--quiet
ordering output:
--topo-order
--date-order
--reverse
formatting output:
--parents
--children
--objects | --objects-edge
--unpacked
--header | --pretty
--abbrev=<n> | --no-abbrev
--abbrev-commit
--left-right
--count
special purpose:
--bisect
--bisect-vars
--bisect-all
Description
After upgrading from Gitea 1.15.9 to 1.16.1, a 500 error is reported when entering an empty repository. When downgrading to 1.15.9 again everything is without problems.
Screenshots
No response
Activity
wxiaoguang commentedon Feb 11, 2022
Possible related to:
I guess that old git need at lease one<commit>
in the arguments. New git can omit the<commit>
(update: actually, it's a git bug, old version only,
rev-list --all
doesn't work on an empty repo)wxiaoguang commentedon Feb 11, 2022
Confirmed, it is the case. But git document never mentioned that.
If we run
git rev-list --all
on an empty git, old git would report errors.lunny commentedon Feb 11, 2022
What's the old git version?
zeripath commentedon Feb 12, 2022
Can we use:
Instead.
Btw @lunny I missed your reply on my comment:
Still just uses the HEAD branch. If we wanted to check if a repo had any branches or tags we'd need to use for-each-ref or the like.
wxiaoguang commentedon Feb 13, 2022
Author reported
2.13.6
, I tried2.11.x
, they all have this bug. It seems that2.3x
doesn't have the bug, but I do not know which version fixed it.lunny commentedon Feb 13, 2022
git show-ref HEAD
is not work from me.