mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-31 03:14:17 +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:
3 files changed
+68
-3
No files matched your search
@@ -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