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:
10
renderer.js
10
renderer.js
@@ -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 folder‐path 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 {
|
||||
|
||||
Reference in New Issue
Block a user