Skip to content

Old git cli (maybe < 2) can not do IsEmpty check correctly #19086

Closed
@IT-AlexKor

Description

@IT-AlexKor

Gitea Version

1.16.3

Git Version

1.8.3.1

Operating System

CentOS Linux 7 (Core)

How are you running Gitea?

Self-hosted instance in ProxMox

configuration:

APP_NAME = <ERASED>
RUN_USER = git
RUN_MODE = prod

[security]
INTERNAL_TOKEN     = <ERASED>
INSTALL_LOCK       = true
SECRET_KEY         = <ERASED>
PASSWORD_HASH_ALGO = pbkdf2
DISABLE_GIT_HOOKS  = false

[database]
DB_TYPE  = postgres
HOST     = <ERASED>
NAME     = <ERASED>
USER     = <ERASED>
PASSWD   = <ERASED>
SCHEMA   =
SSL_MODE = disable
CHARSET  = utf8
PATH     = /var/lib/gitea/data/gitea.db
LOG_SQL  = false

[repository]
ROOT = /var/lib/gitea/data/gitea-repositories

[server]
SSH_DOMAIN       = <ERASED>
DOMAIN           = <ERASED>
HTTP_PORT        = 3000
ROOT_URL         = https://<ERASED>/
DISABLE_SSH      = false
SSH_PORT         = 22
LFS_START_SERVER = true
LFS_CONTENT_PATH = /var/lib/gitea/data/lfs
LFS_JWT_SECRET   = <ERASED>
OFFLINE_MODE     = false

[mailer]
ENABLED = true
HOST    = <ERASED>
FROM    = <ERASED>
USER    =
PASSWD  =

[service]
REGISTER_EMAIL_CONFIRM            = false
ENABLE_NOTIFY_MAIL                = false
DISABLE_REGISTRATION              = false
ALLOW_ONLY_EXTERNAL_REGISTRATION  = false
ENABLE_CAPTCHA                    = false
REQUIRE_SIGNIN_VIEW               = true
DEFAULT_KEEP_EMAIL_PRIVATE        = false
DEFAULT_ALLOW_CREATE_ORGANIZATION = true
DEFAULT_ENABLE_TIMETRACKING       = true
NO_REPLY_ADDRESS                  = noreply.localhost

[picture]
DISABLE_GRAVATAR        = false
ENABLE_FEDERATED_AVATAR = true

[openid]
ENABLE_OPENID_SIGNIN = true
ENABLE_OPENID_SIGNUP = true

[session]
PROVIDER = file

[log]
MODE      = console
LEVEL     = info
ROOT_PATH = /var/lib/gitea/log
ROUTER    = console

[metrics]
ENABLED = true

[mirror]
MIN_INTERVAL = 1m

[indexer]
ISSUE_INDEXER_TYPE = elasticsearch
ISSUE_INDEXER_CONN_STR = http://<ERASED>:9200
ISSUE_INDEXER_NAME = gitea_issues
ISSUE_INDEXER_PATH = indexers/issues.bleve
REPO_INDEXER_ENABLED = true
REPO_INDEXER_TYPE = elasticsearch
REPO_INDEXER_CONN_STR = http://<ERASED>:9200
REPO_INDEXER_NAME = gitea_codes
REPO_INDEXER_PATH = indexers/repos.bleve
UPDATE_BUFFER_LEN = 20
MAX_FILE_SIZE = 1048576
REPO_INDEXER_INCLUDE =
REPO_INDEXER_EXCLUDE = resources/bin/**
STARTUP_TIMEOUT = 30s

Database

PostgreSQL

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Description

Steps to reproduce

  1. Prepare repo on bitbucket with some commits/code
  2. Migrate repo from Bitbucket (with mirroring enabled) via https clone url
  3. After migration ends look at the migrated repository page. It will look like there is no code in repo
  4. Go into repo dir on file system and check via "git log" command that this repo has some commits (and code too)

In DB i see that row with imported repository (in "repository" table) has value "is_empty = true". I think that this behavior caused by change in isempty method 913d6f3

Migration was fine on version 1.15.8, today we update our instance and this new behavior was appered

Example of old code (before commit 913d6f3)
[root@ci-gitea .git]# git rev-list --all --count --max-count=1
1
[root@ci-gitea .git]# git show-ref --head ^HEAD$
[root@ci-gitea .git]

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/confirmedIssue has been reviewed and confirmed to be present or accepted to be implementedissue/workaroundit is or has a workaroundtype/bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions