1
0

Improve Git integration: Add dirty worktree validation for pushes, enhance initial repo setup by auto-generating .gitignore rules, and refactor Gitea API error handling.

This commit is contained in:
2026-07-12 11:04:14 +02:00
parent 0fc4ea8da0
commit 72fa7026bf
3 changed files with 149 additions and 16 deletions

View File

@@ -59,8 +59,16 @@ window.addEventListener('DOMContentLoaded', async () => {
pushBtn.textContent = 'Pushing…';
try {
const hasUncommittedFiles = await window.electronAPI.hasDiffs(selected);
if (hasUncommittedFiles) {
const confirmed = confirm(
'This repository contains uncommitted or untracked files.\n\n' +
'Only committed files will be pushed. Continue anyway?'
);
if (!confirmed) return;
}
// send the folderpath to main via a new IPC channel 'push-to-gitea'
const result = await window.electronAPI.pushToGitea(selected.path);
const result = await window.electronAPI.pushToGitea(selected.path, hasUncommittedFiles);
if (result.success) {
alert('✔ Pushed successfully to Gitea: ' + result.repoUrl);
} else {