Skip to content

Commit

Permalink
fix: ensure git reset before pull in ubuntu provider (#52)
Browse files Browse the repository at this point in the history
Signed-off-by: Weston Steimel <[email protected]>
  • Loading branch information
westonsteimel authored Jan 30, 2023
1 parent ac953b1 commit 15d178c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/vunnel/providers/ubuntu/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class GitWrapper:
_check_out_cmd_ = "git checkout {branch}"
_pull_cmd_ = "git pull -f"
_fetch_cmd_ = "git fetch --all"
_reset_cmd_ = "git reset --hard HEAD"
_pull_ff_only_cmd_ = "git pull --ff-only"
_write_graph_ = "git commit-graph write --reachable --changed-paths"
_change_set_cmd_ = "git log --no-renames --no-merges --name-status --format=oneline {from_rev}..{to_rev}"
Expand Down Expand Up @@ -122,6 +123,7 @@ def sync_with_upstream(self):
try:
self._exec_cmd(self._set_remote_cmd_.format(src=self.src), cwd=self.dest)
self._exec_cmd(self._check_out_cmd_.format(branch=self.branch), cwd=self.dest)
self._exec_cmd(self._reset_cmd_, cwd=self.dest)
except: # nosec
pass
out = self._exec_cmd(self._pull_ff_only_cmd_, cwd=self.dest)
Expand Down

0 comments on commit 15d178c

Please sign in to comment.