aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/release.yml2
-rw-r--r--scripts/test_release.py5
2 files changed, 5 insertions, 2 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 64ae182b..2991afe7 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -455,7 +455,7 @@ jobs:
exit 0
fi
# Apply only release preparation, never the hotfix implementation or newer master code.
- git diff --binary "$PREVIEW_COMMIT" "$GITHUB_REF_NAME" > "$RUNNER_TEMP/release-preparation.patch"
+ git diff --binary --default-prefix "$PREVIEW_COMMIT" "$GITHUB_REF_NAME" > "$RUNNER_TEMP/release-preparation.patch"
if [ -s "$RUNNER_TEMP/release-preparation.patch" ]; then
git apply --3way --index "$RUNNER_TEMP/release-preparation.patch"
fi
diff --git a/scripts/test_release.py b/scripts/test_release.py
index f495c89c..bf79c0e8 100644
--- a/scripts/test_release.py
+++ b/scripts/test_release.py
@@ -193,7 +193,10 @@ class ReleaseTests(unittest.TestCase):
release.select_hotfix("release/hotfix", "v2.0.0")
candidate = self.prepare()
release.validate_diff(hotfix, candidate, "1.0.1")
- patch = subprocess.check_output(["git", "diff", "--binary", hotfix, candidate])
+ # Reproduce a developer git config with diff prefixes disabled; the
+ # explicit --default-prefix must keep the patch applicable to git apply -p1.
+ self.git("config", "diff.noprefix", "true")
+ patch = subprocess.check_output(["git", "diff", "--binary", "--default-prefix", hotfix, candidate])
self.git("checkout", "-q", "master")
subprocess.run(["git", "apply", "--3way", "--index"], input=patch, check=True)
self.assertEqual(Path("src/feature.rs").read_text(), "b and c\n")