easegit-cli 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/git/plumbing.js +6 -5
- package/package.json +1 -1
package/dist/git/plumbing.js
CHANGED
|
@@ -123,9 +123,8 @@ function createCheckpointRef(treeSha, operation) {
|
|
|
123
123
|
const timestamp = Date.now();
|
|
124
124
|
const refName = `refs/easegit/checkpoints/${timestamp}`;
|
|
125
125
|
// Create a commit object for the checkpoint
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
const commitArgs = ['commit-tree', treeSha, '-m', message];
|
|
126
|
+
// Use multiple -m flags for multi-line messages (Windows compatible)
|
|
127
|
+
const commitArgs = ['commit-tree', treeSha, '-m', `EaseGit checkpoint before ${operation}`, '-m', `Timestamp: ${timestamp}`];
|
|
129
128
|
try {
|
|
130
129
|
const head = gitExec(['rev-parse', 'HEAD']);
|
|
131
130
|
commitArgs.splice(2, 0, '-p', head);
|
|
@@ -178,12 +177,14 @@ function getCheckpointInfo(refName) {
|
|
|
178
177
|
function restoreFromTree(commitSha) {
|
|
179
178
|
// Get the tree from the commit
|
|
180
179
|
const treeSha = gitExec(['rev-parse', `${commitSha}^{tree}`]);
|
|
180
|
+
// Clear working directory first (except .git)
|
|
181
|
+
gitExec(['clean', '-fd']);
|
|
181
182
|
// Read the tree into index
|
|
182
183
|
gitExec(['read-tree', treeSha]);
|
|
183
184
|
// Checkout all files from index into working directory
|
|
184
185
|
gitExec(['checkout-index', '-f', '-a']);
|
|
185
|
-
//
|
|
186
|
-
gitExec(['
|
|
186
|
+
// Reset the index to match the restored tree so git status shows clean
|
|
187
|
+
gitExec(['reset', '--mixed']);
|
|
187
188
|
}
|
|
188
189
|
/**
|
|
189
190
|
* Check if there are merge conflicts
|