File tree 1 file changed +3
-20
lines changed 1 file changed +3
-20
lines changed Original file line number Diff line number Diff line change @@ -177,26 +177,9 @@ func CreateBranch(ctx *context.APIContext) {
177
177
var err error
178
178
179
179
if len (opt .OldRefName ) > 0 {
180
- if ctx .Repo .GitRepo .IsBranchExist (opt .OldRefName ) {
181
- oldCommit , err = ctx .Repo .GitRepo .GetBranchCommit (opt .OldRefName )
182
- if err != nil {
183
- ctx .Error (http .StatusInternalServerError , "GetBranchCommit" , err )
184
- return
185
- }
186
- } else if ctx .Repo .GitRepo .IsTagExist (opt .OldRefName ) {
187
- oldCommit , err = ctx .Repo .GitRepo .GetTagCommit (opt .OldRefName )
188
- if err != nil {
189
- ctx .Error (http .StatusInternalServerError , "GetTagCommit" , err )
190
- return
191
- }
192
- } else if len (opt .OldRefName ) == git .SHAFullLength {
193
- oldCommit , err = ctx .Repo .GitRepo .GetCommit (opt .OldRefName )
194
- if err != nil {
195
- ctx .Error (http .StatusInternalServerError , "GetCommit" , err )
196
- return
197
- }
198
- } else {
199
- ctx .Error (http .StatusNotFound , "" , "OldRefName is not exits." )
180
+ oldCommit , err = ctx .Repo .GitRepo .GetCommit (opt .OldRefName )
181
+ if err != nil {
182
+ ctx .Error (http .StatusInternalServerError , "GetCommit" , err )
200
183
return
201
184
}
202
185
} else if len (opt .OldBranchName ) > 0 {
You can’t perform that action at this time.
0 commit comments