Skip to content

Commit

Permalink
modify logic
Browse files Browse the repository at this point in the history
  • Loading branch information
TimHuynh committed Nov 28, 2023
1 parent 8cc88be commit ba73052
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions api/repo/repair.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,12 @@ func RepairRepo(c *gin.Context) {
return
}

// set sourceRepo PreviousName to old name
sourceRepo.SetPreviousName(r.GetName())
// set sourceRepo PreviousName to old name if name is changed
// ignore if repo is transferred and name is unchanged
if sourceRepo.GetName() != r.GetName() {
sourceRepo.SetPreviousName(r.GetName())
}

r, err = wh.RenameRepository(ctx, h, sourceRepo, c, m)
if err != nil {
util.HandleError(c, http.StatusInternalServerError, err)
Expand Down

0 comments on commit ba73052

Please sign in to comment.