From d41a33f7edc860624e4fb67000e2fc470a8d0df4 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Tue, 18 Aug 2026 11:42:03 +0800 Subject: feat(ci-new): preserve dirty changes across CI lock Store dirty workspace changes in a temporary commit so `git-unlock` can restore them, with the marker file content (`true`/`false`) recording which restore path to take. --- mingling_ci/src/git.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'mingling_ci/src/git.rs') diff --git a/mingling_ci/src/git.rs b/mingling_ci/src/git.rs index 39f8976..3d1404b 100644 --- a/mingling_ci/src/git.rs +++ b/mingling_ci/src/git.rs @@ -3,13 +3,18 @@ use std::ffi::OsStr; use std::process::Command; -/// Marker file created by `git-lock` when the working tree is clean, so that a -/// temporary commit can always be made; `git-unlock` removes it. Its presence -/// marks "CI phase in progress". +/// Marker file created by `git-lock` in the CI temporary commit; its content +/// is `true` when the tree was dirty (a base TEMP commit exists below) or +/// `false` when it was clean. `git-unlock` reads it to pick the restore path. pub(crate) const LOCK_FILE: &str = "MINGLING-CI-CHECKING"; -/// Temporary commit message used by `git-lock`. -pub(crate) const TEMP_COMMIT_MESSAGE: &str = "[DO NOT PUSH] CI TEMP [DO NOT PUSH]"; +/// First temporary commit: packs the dirty workspace changes so they can be +/// restored later. Only created when the tree is dirty. +pub(crate) const TEMP_COMMIT_MESSAGE: &str = "[DO NOT PUSH] TEMP [DO NOT PUSH]"; + +/// Second temporary commit: carries the marker file, and its message is what +/// `git-unlock` matches to confirm the CI phase. +pub(crate) const CI_TEMP_COMMIT_MESSAGE: &str = "[DO NOT PUSH] CI TEMP [DO NOT PUSH]"; /// Case-sensitive substring that identifies a CI temporary commit in the HEAD /// commit message. -- cgit