maiass 5.8.8 → 5.8.9
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/lib/commit.js +6 -0
- package/lib/git-info.js +8 -3
- package/package.json +1 -1
package/lib/commit.js
CHANGED
|
@@ -829,6 +829,12 @@ export async function commitThis(options = {}) {
|
|
|
829
829
|
|
|
830
830
|
const status = gitInfo.status;
|
|
831
831
|
|
|
832
|
+
// Handle case where status might be null (shouldn't happen but defensive)
|
|
833
|
+
if (!status) {
|
|
834
|
+
log.error(SYMBOLS.CROSS, 'Unable to get git status');
|
|
835
|
+
return false;
|
|
836
|
+
}
|
|
837
|
+
|
|
832
838
|
// Check if there are any changes
|
|
833
839
|
if (status.isClean) {
|
|
834
840
|
log.success(SYMBOLS.CHECKMARK, 'No changes found. Working directory is clean.');
|
package/lib/git-info.js
CHANGED
|
@@ -335,12 +335,17 @@ export function getGitInfo(options = {}) {
|
|
|
335
335
|
|
|
336
336
|
const branch = getCurrentBranch();
|
|
337
337
|
if (!branch) {
|
|
338
|
+
// No branch yet (new repo with no commits) - still get status
|
|
339
|
+
const status = getGitStatus();
|
|
338
340
|
return {
|
|
339
341
|
isRepository: true,
|
|
340
342
|
currentBranch: null,
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
343
|
+
branch: null,
|
|
344
|
+
hasChanges: status ? status.hasChanges : false,
|
|
345
|
+
isClean: status ? status.isClean : true,
|
|
346
|
+
status,
|
|
347
|
+
stagedChanges: status ? status.staged : [],
|
|
348
|
+
unstagedChanges: status ? status.unstaged : [],
|
|
344
349
|
gitAuthor: null,
|
|
345
350
|
jiraTicket: null
|
|
346
351
|
};
|