Skip to content

Fix all unit tests without git.Init after #19732 merged, clean code for git < 2.0 after #19577 #19874

Closed
@wxiaoguang

Description

@wxiaoguang

At the moment, PR #19732 doesn't ensure all unit tests call git.Init correctly.

// at the moment, we just use a temp HomeDir to prevent from conflicting with user's git config
// in future, the git module should be initialized first before use.
HomeDir = filepath.Join(os.TempDir(), "/gitea-temp-home")
log.Warn("Git's HomeDir is empty, the git module is not initialized correctly, using a temp HomeDir (%s) temporarily", HomeDir) 

This issue is here to remind that these unit tests should be fixed after #19732 gets merged.

And one more thing, since Gitea 1.17 has dropped Git<2.0 (#19577), some code might be cleaned, too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions