From 016ecafa32cd8d962531afa1afda2fdcd405bf86 Mon Sep 17 00:00:00 2001 From: Joseph Eng Date: Sun, 14 Jul 2024 17:58:48 -0700 Subject: [PATCH] Fix bug with autoupdating the stack_walker tag --- upstream_utils/upstream_utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/upstream_utils/upstream_utils.py b/upstream_utils/upstream_utils.py index cd3c7f47eea..54e47dd245b 100644 --- a/upstream_utils/upstream_utils.py +++ b/upstream_utils/upstream_utils.py @@ -268,7 +268,7 @@ def get_repo_path(self, tempdir=None): return dest def open_repo(self, *, err_msg_if_absent): - os.chdir(tempfile.gettempdir() + os.chdir(tempfile.gettempdir()) dest = self.get_repo_path(os.getcwd()) @@ -365,19 +365,20 @@ def format_patch(self, tag=None): err_msg_if_absent='There\'s nothing to run format-patch on. Run the "clone" and "rebase" commands first.' ) + start_commit = tag if self.pre_patch_commits > 0: commits_since_tag_output = subprocess.run( ["git", "log", "--format=format:%h", f"{tag}..HEAD"], capture_output=True, ).stdout commits_since_tag = commits_since_tag_output.count(b"\n") + 1 - tag = f"HEAD~{commits_since_tag - self.pre_patch_commits}" + start_commit = f"HEAD~{commits_since_tag - self.pre_patch_commits}" subprocess.run( [ "git", "format-patch", - f"{tag}..HEAD", + f"{start_commit}..HEAD", "--abbrev=40", "--zero-commit", "--no-signature",