Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions src/main/services/GitService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,23 +166,6 @@ export async function revertFile(
taskPath: string,
filePath: string
): Promise<{ action: 'unstaged' | 'reverted' }> {
// Check if file is staged
try {
const { stdout: stagedStatus } = await execFileAsync(
'git',
['diff', '--cached', '--name-only', '--', filePath],
{
cwd: taskPath,
}
);

if (stagedStatus.trim()) {
// File is staged, unstage it (but keep working directory changes)
await execFileAsync('git', ['reset', 'HEAD', '--', filePath], { cwd: taskPath });
return { action: 'unstaged' };
}
} catch {}

// Check if file is tracked in git (exists in HEAD)
let fileExistsInHead = false;
try {
Expand Down