From 6bd5d72100cb7b0872fc38d4af4ddd8bd8688733 Mon Sep 17 00:00:00 2001 From: Adam Majer Date: Mon, 10 Jun 2024 15:35:11 +0200 Subject: [PATCH] New branch is empty New branches must be born empty --- lib/git.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/git.py b/lib/git.py index 3e25398..c92472d 100644 --- a/lib/git.py +++ b/lib/git.py @@ -86,7 +86,7 @@ class Git: """Checkout into the branch HEAD""" new_branch = False if branch not in self.branches(): - self.git_run(["branch", "-q", branch, "HEAD"]) + self.git_run(["switch", "-q", "--orphan", branch]) new_branch = True else: ref = f"refs/heads/{branch}"