Skip to content

Commit

Permalink
Insert scratch branch after adding the causal hash table
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPenner committed Jun 24, 2024
1 parent 1c186d4 commit 60f99c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion codebase2/codebase-sqlite/U/Codebase/Sqlite/Queries.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3755,7 +3755,7 @@ loadProjectAndBranchNames projectId branchId =
|]

-- | Insert a project branch.
insertProjectBranch :: Text -> CausalHashId -> ProjectBranch -> Transaction ()
insertProjectBranch :: HasCallStack => Text -> CausalHashId -> ProjectBranch -> Transaction ()
insertProjectBranch description causalHashId (ProjectBranch projectId branchId branchName maybeParentBranchId) = do
-- Ensure we never point at a causal we don't have the branch for.
_ <- expectBranchObjectIdByCausalHashId causalHashId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@ createSchema = do
Q.addMostRecentNamespaceTable
Sqlite.execute insertSchemaVersionSql
Q.addSquashResultTable
(_, emptyCausalHashId) <- emptyCausalHash
void $ insertProjectAndBranch scratchProjectName scratchBranchName emptyCausalHashId
Q.addProjectBranchCausalHashIdColumn
(_, emptyCausalHashId) <- emptyCausalHash
(_, ProjectBranch {projectId, branchId}) <- insertProjectAndBranch scratchProjectName scratchBranchName emptyCausalHashId
Q.setCurrentProjectPath projectId branchId []
Q.addProjectBranchReflogTable
Q.addProjectBranchCausalHashIdColumn
where
Expand Down

0 comments on commit 60f99c2

Please sign in to comment.