Skip to content

Commit

Permalink
fix unpatch when existing multiple patches (#221)
Browse files Browse the repository at this point in the history
当存在多个patch文件时,原代码逻辑判断当前base_commit_id_now存在bug。

Co-authored-by: caozhou <[email protected]>
  • Loading branch information
cifar10 and Caozhou1995 authored Sep 24, 2024
1 parent d876d9c commit 08cff6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/patch/unpatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ def apply_patch(repo, device_type, base_commit_id, dir_path, tmp_str=None):
# Get the base_commit_id stored in FlagScale.
base_commit_id_now = [
f for f in files_and_folders if os.path.isdir(os.path.join(patch_dir, f))
][0]
]

# Check if the stored base_commit_id matches the input base_commit_id
if base_commit_id_now != base_commit_id:
if base_commit_id not in base_commit_id_now:
raise FileNotFoundError("Base_commit_id is not matched")
base_commit_id_dir = os.path.join(patch_dir, base_commit_id)

Expand Down

0 comments on commit 08cff6c

Please sign in to comment.