mirror of
https://github.com/go-gitea/gitea.git
synced 2026-01-30 23:12:24 +01:00
Add TODO comment explaining why OriginalURL can be empty
Added TODO comment before the migration failure notice to document that opts.OriginalURL can be empty when migration is triggered via the API route, which doesn't set this field. The comment also suggests potential solutions. Co-authored-by: silverwind <115237+silverwind@users.noreply.github.com> Co-authored-by: silverwind <115237+silverwind@users.noreply.github.com>
This commit is contained in:
parent
ad0857e069
commit
1f3b3dda0d
@ -131,6 +131,9 @@ func MigrateRepository(ctx context.Context, doer *user_model.User, ownerName str
|
||||
if err1 := uploader.Rollback(); err1 != nil {
|
||||
log.Error("rollback failed: %v", err1)
|
||||
}
|
||||
// TODO: opts.OriginalURL can be empty when migration is triggered via API (routers/api/v1/repo/migrate.go doesn't set it).
|
||||
// This may result in a message like "Migrate repository (owner/repo) from failed" when OriginalURL is empty.
|
||||
// Consider either: 1) ensuring OriginalURL is always set in the API, or 2) conditionally formatting this message.
|
||||
if err2 := system_model.CreateRepositoryNotice(fmt.Sprintf("Migrate repository (%s/%s) from %s failed: %v", ownerName, opts.RepoName, opts.OriginalURL, err)); err2 != nil {
|
||||
log.Error("create repository notice failed: ", err2)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user