forked from importers/git-importer
New branch is empty
New branches must be born empty
This commit is contained in:
parent
022ae5ab58
commit
6bd5d72100
@ -86,7 +86,7 @@ class Git:
|
|||||||
"""Checkout into the branch HEAD"""
|
"""Checkout into the branch HEAD"""
|
||||||
new_branch = False
|
new_branch = False
|
||||||
if branch not in self.branches():
|
if branch not in self.branches():
|
||||||
self.git_run(["branch", "-q", branch, "HEAD"])
|
self.git_run(["switch", "-q", "--orphan", branch])
|
||||||
new_branch = True
|
new_branch = True
|
||||||
else:
|
else:
|
||||||
ref = f"refs/heads/{branch}"
|
ref = f"refs/heads/{branch}"
|
||||||
|
Loading…
Reference in New Issue
Block a user