Skip to content

Commit 26563d4

Browse files
committed
Update ignore_template_commit to ignore checkout changes
We don't want to see diffs when running `sync` with a custom template version, since this flag is primarily intended to be run on template repo PRs where we don't care that the template version changes since the actual change will only be applied once we merge the PR.
1 parent ac46b18 commit 26563d4

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

commodore/dependency_templater.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,20 @@ def _ignore_cruft_json_commit_id(
4949
n=0,
5050
)
5151
)[3:]
52-
# If the context-less diff has exactly 2 lines and both of them start with
53-
# '[-+] "commit":', we omit the diff
5452
if (
53+
# If the context-less diff has exactly 2 lines and both of them start with
54+
# '[-+] "commit":', we omit the diff
5555
len(minimal_diff) == 2
5656
and minimal_diff[0].startswith('- "commit":')
5757
and minimal_diff[1].startswith('+ "commit":')
58+
) or (
59+
# If the context-less diff has exactly 4 lines and the two pairs start with
60+
# '[-+] "commit":' and '[-+] "checkout":', we omit the diff
61+
len(minimal_diff) == 4
62+
and minimal_diff[0].startswith('- "commit":')
63+
and minimal_diff[1].startswith('- "checkout":')
64+
and minimal_diff[2].startswith('+ "commit":')
65+
and minimal_diff[3].startswith('+ "checkout":')
5866
):
5967
omit = True
6068
# never suppress diffs in default difffunc

0 commit comments

Comments
 (0)