Skip to content

Commit 84d3c18

Browse files
committed
fix branch naming
1 parent e4c96c9 commit 84d3c18

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

engine/internal/srv/branch.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func (s *Server) createBranch(w http.ResponseWriter, r *http.Request) {
126126
return
127127
}
128128

129-
if _, ok := branches[createRequest.BranchName]; ok {
129+
if _, ok := branches[models.BranchName(fsm.Pool().Name, createRequest.BranchName)]; ok {
130130
api.SendBadRequestError(w, r, fmt.Sprintf("branch '%s' already exists", createRequest.BranchName))
131131
return
132132
}
@@ -139,7 +139,7 @@ func (s *Server) createBranch(w http.ResponseWriter, r *http.Request) {
139139
return
140140
}
141141

142-
branchPointer, ok := branches[createRequest.BaseBranch]
142+
branchPointer, ok := branches[createRequest.BranchName]
143143
if !ok {
144144
api.SendBadRequestError(w, r, "base branch not found")
145145
return
@@ -256,7 +256,7 @@ func (s *Server) snapshot(w http.ResponseWriter, r *http.Request) {
256256
return
257257
}
258258

259-
currentSnapshotID, ok := branches[clone.Branch]
259+
currentSnapshotID, ok := branches[models.BranchName(fsm.Pool().Name, clone.Branch)]
260260
if !ok {
261261
api.SendBadRequestError(w, r, "branch not found: "+clone.Branch)
262262
return

engine/internal/srv/routes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ func (s *Server) createClone(w http.ResponseWriter, r *http.Request) {
344344
return
345345
}
346346

347-
snapshotID, ok := branches[cloneRequest.Branch]
347+
snapshotID, ok := branches[models.BranchName(fsm.Pool().Name, cloneRequest.Branch)]
348348
if !ok {
349349
api.SendBadRequestError(w, r, "branch not found")
350350
return

0 commit comments

Comments
 (0)