Skip to content

Commit b12e678

Browse files
committed
fix: check for existing name on branch creation
1 parent d1e4f72 commit b12e678

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sqlite3.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63204,6 +63204,9 @@ SQLITE_PRIVATE int pragma_new_branch(sqlite3 *db, int iDb, char *zBranchName, ch
6320463204
if( (rc=sqlite3BranchCheckReloadDb(pPager,0))!=SQLITE_OK ) return rc;
6320563205
}
6320663206

63207+
/* check if the new branch name already exists */
63208+
if( sqlite3BranchFind(lmdb,zBranchName) > 0 ) return SQLITE_MISUSE;
63209+
6320763210
/* check if the source branch is valid */
6320863211
source_branch_id = sqlite3BranchFind(lmdb, zSourceBranch);
6320963212
if( source_branch_id <= 0 ) return SQLITE_NOTFOUND;

0 commit comments

Comments
 (0)