Skip to content

Commit

Permalink
bugfix for when worktree directory removed inbetween refreshes
Browse files Browse the repository at this point in the history
  • Loading branch information
indy-independence committed Aug 30, 2024
1 parent 5b5b02f commit 605a647
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/cnaas_nms/db/git_worktrees.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def refresh_templates_worktree(branch: str):
os.mkdir("/tmp/worktrees")
logger.debug("Adding worktree for templates branch {} in folder {}".format(branch, branch_folder))
try:
local_repo.git.worktree("prune")
local_repo.git.worktree("add", branch_folder, branch)
except git.exc.GitCommandError as e:
logger.error("Error adding worktree for templates branch {}: {}".format(branch, e.stderr.strip()))
Expand Down

0 comments on commit 605a647

Please sign in to comment.