@mohshomis/ckpt 0.1.0 → 0.1.1
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/core.js +4 -0
- package/package.json +1 -1
package/dist/core.js
CHANGED
|
@@ -77,6 +77,10 @@ export function startSession(cwd) {
|
|
|
77
77
|
if (existing) {
|
|
78
78
|
throw new Error(`Session already active (${existing.id}). Run "ckpt end" or "ckpt end --discard" first.`);
|
|
79
79
|
}
|
|
80
|
+
// If repo has no commits yet, create an initial one
|
|
81
|
+
if (!gitSafe('rev-parse HEAD', cwd)) {
|
|
82
|
+
git('commit --allow-empty -m "initial commit"', cwd);
|
|
83
|
+
}
|
|
80
84
|
const status = git('status --porcelain', cwd);
|
|
81
85
|
if (status) {
|
|
82
86
|
git('stash push -m "ckpt: auto-stash before session"', cwd);
|