Fix "git pull" listing changed files

This commit is contained in:
Alex Gleason committed 2025-09-30 12:47:21 -05:00
1 parent b7e94ff67c
commit df39f78d20
2 files changed
+48 -5

No files matched your search

+9 -5
View File
@@ -69,12 +69,16 @@ export class GitPullCommand implements GitSubcommand {
dir: this.pwd,
});
const hasChanges = statusMatrix.some(([, headStatus, workdirStatus, stageStatus]) => {
return headStatus !== workdirStatus || headStatus !== stageStatus;
});
const modifiedFiles = statusMatrix
.filter(([, headStatus, workdirStatus, stageStatus]) => {
// Check for any uncommitted changes (modified, staged, or untracked)
return headStatus !== workdirStatus || headStatus !== stageStatus;
})
.map(([filepath]) => filepath);
if (hasChanges) {
return createErrorResult('error: Your local changes to the following files would be overwritten by merge:\nPlease commit your changes or stash them before you merge.');
if (modifiedFiles.length > 0) {
const fileList = modifiedFiles.map(file => `\t${file}`).join('\n');
return createErrorResult(`error: Your local changes to the following files would be overwritten by merge:\n${fileList}\nPlease commit your changes or stash them before you merge.`);
}
try {