mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-17 16:42:19 +09:00
Backport #39799 Fixes #39794 Co-authored-by: fixfon <12512757+fixfon@users.noreply.github.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
co-authored by
fixfon
wxiaoguang
parent
96cb6cd16f
commit
c4e9d96162
@@ -27,6 +27,7 @@ type FastImportFile struct {
|
||||
|
||||
type FastImportCommit struct {
|
||||
Ref string
|
||||
Parent string
|
||||
Message string
|
||||
Files []FastImportFile
|
||||
|
||||
@@ -72,6 +73,9 @@ func ForceFastImport(ctx context.Context, repo RepositoryFacade, commits []FastI
|
||||
|
||||
msg := util.IfZero(c.Message, fmt.Sprintf("test commit %d", i+1))
|
||||
_, _ = fmt.Fprintf(buf, "data %d\n%s\n", len(msg), msg)
|
||||
if c.Parent != "" {
|
||||
_, _ = fmt.Fprintf(buf, "from %s\n", c.Parent)
|
||||
}
|
||||
|
||||
for _, f := range c.Files {
|
||||
mode := util.IfZero(f.Mode, EntryModeBlob)
|
||||
|
||||
Reference in New Issue
Block a user