aboutsummaryrefslogtreecommitdiff
path: root/mingling_ci/src/git.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-08-18 11:42:03 +0800
committer魏曹先生 <1992414357@qq.com>2026-08-18 11:42:03 +0800
commitd41a33f7edc860624e4fb67000e2fc470a8d0df4 (patch)
tree8e83e1165121b353bd65bae85c41b37db85e9556 /mingling_ci/src/git.rs
parent8e92f02cc12d35985cefebfe0f3ab54a94a0aa97 (diff)
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.
Diffstat (limited to 'mingling_ci/src/git.rs')
-rw-r--r--mingling_ci/src/git.rs15
1 files changed, 10 insertions, 5 deletions
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.