Skip to content

Commit

Permalink
fix: pull command will create missing local branches
Browse files Browse the repository at this point in the history
  • Loading branch information
stevearc committed Jan 18, 2024
1 parent 12b8463 commit 9c90da8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gitstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -1682,9 +1682,14 @@ def run(self, branch: Optional[str] = None, force: bool = False) -> None:
target = branch

git.fetch()
all_branches = git.list_branches()

while branch:
git.switch_branch(branch)
if branch not in all_branches:
git.create_branch(branch, "HEAD")
else:
git.switch_branch(branch)

if force:
git.reset("origin/" + branch, hard=True)
else:
Expand Down

0 comments on commit 9c90da8

Please sign in to comment.