Drop diffs with only mode changes
This commit is contained in:
parent
810ccab884
commit
26447c8205
2 changed files with 4 additions and 4 deletions
|
|
@ -118,7 +118,7 @@ def main() -> None:
|
||||||
|
|
||||||
for section in sections:
|
for section in sections:
|
||||||
if not section["hunks"]:
|
if not section["hunks"]:
|
||||||
output_lines.extend(section["header"])
|
left_out = True
|
||||||
continue
|
continue
|
||||||
|
|
||||||
kept_hunks = []
|
kept_hunks = []
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ setup() {
|
||||||
assert_output ""
|
assert_output ""
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "keeps diff with only mode change" {
|
@test "drops diff with only mode change" {
|
||||||
printf "%s\n" "foo" >"$BATS_TEST_TMPDIR/old"
|
printf "%s\n" "foo" >"$BATS_TEST_TMPDIR/old"
|
||||||
printf "%s\n" "foo" >"$BATS_TEST_TMPDIR/new"
|
printf "%s\n" "foo" >"$BATS_TEST_TMPDIR/new"
|
||||||
chmod 0644 "$BATS_TEST_TMPDIR/old"
|
chmod 0644 "$BATS_TEST_TMPDIR/old"
|
||||||
|
|
@ -40,8 +40,8 @@ setup() {
|
||||||
"$BATS_TEST_TMPDIR/new" || true)"
|
"$BATS_TEST_TMPDIR/new" || true)"
|
||||||
|
|
||||||
run mechanicaldiff.py foo bar <<<"$diff_output"
|
run mechanicaldiff.py foo bar <<<"$diff_output"
|
||||||
assert_success
|
assert_failure
|
||||||
assert_output "$diff_output"
|
assert_output ""
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "drops one hunk and keeps another" {
|
@test "drops one hunk and keeps another" {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue