mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-06 21:12:55 +00:00
Remove parent_id from the restored branch
This commit is contained in:
@@ -370,9 +370,7 @@ class NeonProject:
|
||||
return target
|
||||
|
||||
def get_random_parent_branch(self) -> NeonBranch:
|
||||
return self.branches[
|
||||
random.choice(list(set(self.branches.keys()) - self.reset_branches))
|
||||
]
|
||||
return self.branches[random.choice(list(set(self.branches.keys()) - self.reset_branches))]
|
||||
|
||||
def generate_branch_name(self) -> str:
|
||||
self.branch_num += 1
|
||||
@@ -526,11 +524,10 @@ class NeonProject:
|
||||
)
|
||||
self.wait()
|
||||
new_branch_def = self.neon_api.get_branch_details(self.id, new_branch_def["branch"]["id"])
|
||||
new_branch_def["branch"].pop("parent_id")
|
||||
# XXX do not merge, debug only
|
||||
log.info("new_branch: %s", new_branch_def)
|
||||
new_branch = NeonBranch(
|
||||
self, new_branch_def
|
||||
)
|
||||
new_branch = NeonBranch(self, new_branch_def)
|
||||
target_branch_def = self.neon_api.get_branch_details(self.id, target_branch.id)
|
||||
if "name" in target_branch_def["branch"]:
|
||||
target_branch.name = target_branch_def["branch"]["name"]
|
||||
|
||||
Reference in New Issue
Block a user