@@ -23,67 +23,67 @@ type PushUpdateOptions struct {
23
23
}
24
24
25
25
// IsNewRef return true if it's a first-time push to a branch, tag or etc.
26
- func (opts PushUpdateOptions ) IsNewRef () bool {
26
+ func (opts * PushUpdateOptions ) IsNewRef () bool {
27
27
return opts .OldCommitID == git .EmptySHA
28
28
}
29
29
30
30
// IsDelRef return true if it's a deletion to a branch or tag
31
- func (opts PushUpdateOptions ) IsDelRef () bool {
31
+ func (opts * PushUpdateOptions ) IsDelRef () bool {
32
32
return opts .NewCommitID == git .EmptySHA
33
33
}
34
34
35
35
// IsUpdateRef return true if it's an update operation
36
- func (opts PushUpdateOptions ) IsUpdateRef () bool {
36
+ func (opts * PushUpdateOptions ) IsUpdateRef () bool {
37
37
return ! opts .IsNewRef () && ! opts .IsDelRef ()
38
38
}
39
39
40
40
// IsTag return true if it's an operation to a tag
41
- func (opts PushUpdateOptions ) IsTag () bool {
41
+ func (opts * PushUpdateOptions ) IsTag () bool {
42
42
return strings .HasPrefix (opts .RefFullName , git .TagPrefix )
43
43
}
44
44
45
45
// IsNewTag return true if it's a creation to a tag
46
- func (opts PushUpdateOptions ) IsNewTag () bool {
46
+ func (opts * PushUpdateOptions ) IsNewTag () bool {
47
47
return opts .IsTag () && opts .IsNewRef ()
48
48
}
49
49
50
50
// IsDelTag return true if it's a deletion to a tag
51
- func (opts PushUpdateOptions ) IsDelTag () bool {
51
+ func (opts * PushUpdateOptions ) IsDelTag () bool {
52
52
return opts .IsTag () && opts .IsDelRef ()
53
53
}
54
54
55
55
// IsBranch return true if it's a push to branch
56
- func (opts PushUpdateOptions ) IsBranch () bool {
56
+ func (opts * PushUpdateOptions ) IsBranch () bool {
57
57
return strings .HasPrefix (opts .RefFullName , git .BranchPrefix )
58
58
}
59
59
60
60
// IsNewBranch return true if it's the first-time push to a branch
61
- func (opts PushUpdateOptions ) IsNewBranch () bool {
61
+ func (opts * PushUpdateOptions ) IsNewBranch () bool {
62
62
return opts .IsBranch () && opts .IsNewRef ()
63
63
}
64
64
65
65
// IsUpdateBranch return true if it's not the first push to a branch
66
- func (opts PushUpdateOptions ) IsUpdateBranch () bool {
66
+ func (opts * PushUpdateOptions ) IsUpdateBranch () bool {
67
67
return opts .IsBranch () && opts .IsUpdateRef ()
68
68
}
69
69
70
70
// IsDelBranch return true if it's a deletion to a branch
71
- func (opts PushUpdateOptions ) IsDelBranch () bool {
71
+ func (opts * PushUpdateOptions ) IsDelBranch () bool {
72
72
return opts .IsBranch () && opts .IsDelRef ()
73
73
}
74
74
75
75
// TagName returns simple tag name if it's an operation to a tag
76
- func (opts PushUpdateOptions ) TagName () string {
76
+ func (opts * PushUpdateOptions ) TagName () string {
77
77
return opts .RefFullName [len (git .TagPrefix ):]
78
78
}
79
79
80
80
// BranchName returns simple branch name if it's an operation to branch
81
- func (opts PushUpdateOptions ) BranchName () string {
81
+ func (opts * PushUpdateOptions ) BranchName () string {
82
82
return opts .RefFullName [len (git .BranchPrefix ):]
83
83
}
84
84
85
85
// RefName returns simple name for ref
86
- func (opts PushUpdateOptions ) RefName () string {
86
+ func (opts * PushUpdateOptions ) RefName () string {
87
87
if strings .HasPrefix (opts .RefFullName , git .TagPrefix ) {
88
88
return opts .RefFullName [len (git .TagPrefix ):]
89
89
} else if strings .HasPrefix (opts .RefFullName , git .BranchPrefix ) {
@@ -93,7 +93,7 @@ func (opts PushUpdateOptions) RefName() string {
93
93
}
94
94
95
95
// RepoFullName returns repo full name
96
- func (opts PushUpdateOptions ) RepoFullName () string {
96
+ func (opts * PushUpdateOptions ) RepoFullName () string {
97
97
return opts .RepoUserName + "/" + opts .RepoName
98
98
}
99
99
0 commit comments