Skip to content

Commit a490171

Browse files
authored
Merge branch 'master' into issue-page_multi-repo-select
2 parents c4037ed + e151674 commit a490171

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

models/update.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,6 @@ func ListToPushCommits(l *list.List) *PushCommits {
5353
return &PushCommits{l.Len(), commits, "", make(map[string]string), make(map[string]*User)}
5454
}
5555

56-
// PushUpdateOptions defines the push update options
57-
type PushUpdateOptions struct {
58-
PusherID int64
59-
PusherName string
60-
RepoUserName string
61-
RepoName string
62-
RefFullName string
63-
OldCommitID string
64-
NewCommitID string
65-
}
66-
6756
// PushUpdateDeleteTag must be called for any push actions to delete tag
6857
func PushUpdateDeleteTag(repo *Repository, tagName string) error {
6958
rel, err := GetRelease(repo.ID, tagName)

modules/repofiles/update.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,20 @@ func CreateOrUpdateRepoFile(repo *models.Repository, doer *models.User, opts *Up
410410
return file, nil
411411
}
412412

413+
// PushUpdateOptions defines the push update options
414+
type PushUpdateOptions struct {
415+
PusherID int64
416+
PusherName string
417+
RepoUserName string
418+
RepoName string
419+
RefFullName string
420+
OldCommitID string
421+
NewCommitID string
422+
}
423+
413424
// PushUpdate must be called for any push actions in order to
414425
// generates necessary push action history feeds and other operations
415-
func PushUpdate(repo *models.Repository, branch string, opts models.PushUpdateOptions) error {
426+
func PushUpdate(repo *models.Repository, branch string, opts PushUpdateOptions) error {
416427
isNewRef := opts.OldCommitID == git.EmptySHA
417428
isDelRef := opts.NewCommitID == git.EmptySHA
418429
if isNewRef && isDelRef {

routers/private/hook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ func HookPostReceive(ctx *macaron.Context) {
159159
})
160160
return
161161
}
162-
if err := repofiles.PushUpdate(repo, branch, models.PushUpdateOptions{
162+
if err := repofiles.PushUpdate(repo, branch, repofiles.PushUpdateOptions{
163163
RefFullName: refFullName,
164164
OldCommitID: oldCommitID,
165165
NewCommitID: newCommitID,

routers/private/push_update.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818

1919
// PushUpdate update public key updates
2020
func PushUpdate(ctx *macaron.Context) {
21-
var opt models.PushUpdateOptions
21+
var opt repofiles.PushUpdateOptions
2222
if err := json.NewDecoder(ctx.Req.Request.Body).Decode(&opt); err != nil {
2323
ctx.JSON(500, map[string]interface{}{
2424
"err": err.Error(),

routers/repo/branch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func deleteBranch(ctx *context.Context, branchName string) error {
137137
if err := repofiles.PushUpdate(
138138
ctx.Repo.Repository,
139139
branchName,
140-
models.PushUpdateOptions{
140+
repofiles.PushUpdateOptions{
141141
RefFullName: git.BranchPrefix + branchName,
142142
OldCommitID: commit.ID.String(),
143143
NewCommitID: git.EmptySHA,

0 commit comments

Comments
 (0)