summaryrefslogtreecommitdiffstats
path: root/models/action.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-02-23 02:15:53 -0500
committerUnknwon <u@gogs.io>2015-02-23 02:15:53 -0500
commitee68a826a55c6a4305e7f609db57501a54a5bc47 (patch)
tree935e76f3934c68c54fcb0af1f8f51cf8adb9abcd /models/action.go
parente90f014e4a85d163c68ffb2d1d0e5ea888e9b569 (diff)
downloadgitea-ee68a826a55c6a4305e7f609db57501a54a5bc47.tar.gz
gitea-ee68a826a55c6a4305e7f609db57501a54a5bc47.zip
v4 migration, merge 'dev', clean code and mirror fix
Diffstat (limited to 'models/action.go')
-rw-r--r--models/action.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/models/action.go b/models/action.go
index 9ba661f1e2..fee5e5e676 100644
--- a/models/action.go
+++ b/models/action.go
@@ -434,20 +434,20 @@ func NewRepoAction(u *User, repo *Repository) (err error) {
return newRepoAction(x, u, repo)
}
-func transferRepoAction(e Engine, u, newUser *User, repo *Repository) (err error) {
+func transferRepoAction(e Engine, actUser, oldOwner, newOwner *User, repo *Repository) (err error) {
action := &Action{
- ActUserId: u.Id,
- ActUserName: u.Name,
- ActEmail: u.Email,
+ ActUserId: actUser.Id,
+ ActUserName: actUser.Name,
+ ActEmail: actUser.Email,
OpType: TRANSFER_REPO,
RepoId: repo.Id,
- RepoUserName: newUser.Name,
+ RepoUserName: newOwner.Name,
RepoName: repo.Name,
IsPrivate: repo.IsPrivate,
- Content: path.Join(repo.Owner.LowerName, repo.LowerName),
+ Content: path.Join(oldOwner.LowerName, repo.LowerName),
}
if err = notifyWatchers(e, action); err != nil {
- return fmt.Errorf("notify watchers '%d/%s'", u.Id, repo.Id)
+ return fmt.Errorf("notify watchers '%d/%s'", actUser.Id, repo.Id)
}
// Remove watch for organization.
@@ -457,13 +457,13 @@ func transferRepoAction(e Engine, u, newUser *User, repo *Repository) (err error
}
}
- log.Trace("action.TransferRepoAction: %s/%s", u.Name, repo.Name)
+ log.Trace("action.TransferRepoAction: %s/%s", actUser.Name, repo.Name)
return nil
}
// TransferRepoAction adds new action for transferring repository.
-func TransferRepoAction(u, newUser *User, repo *Repository) (err error) {
- return transferRepoAction(x, u, newUser, repo)
+func TransferRepoAction(actUser, oldOwner, newOwner *User, repo *Repository) (err error) {
+ return transferRepoAction(x, actUser, oldOwner, newOwner, repo)
}
// GetFeeds returns action list of given user in given context.