gitxelectron 1.2.7 → 1.2.8

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/out/main/index.js CHANGED
@@ -1376,11 +1376,11 @@ async function cloneRepository(sessionId, remoteUrl, destPath) {
1376
1376
  } else {
1377
1377
  await existingGit.raw(["remote", "add", "origin", authUrl]);
1378
1378
  }
1379
- await existingGit.raw(["-c", "credential.helper=", "fetch", "origin"]);
1379
+ await existingGit.raw(["-c", "credential.helper=", "fetch", "--progress", "origin"]);
1380
1380
  const st = await existingGit.status();
1381
1381
  const branch = st.current || "main";
1382
1382
  try {
1383
- await existingGit.raw(["-c", "credential.helper=", "pull", "origin", branch]);
1383
+ await existingGit.raw(["-c", "credential.helper=", "pull", "--progress", "origin", branch]);
1384
1384
  } catch (e) {
1385
1385
  }
1386
1386
  return destPath;
@@ -1390,7 +1390,7 @@ async function cloneRepository(sessionId, remoteUrl, destPath) {
1390
1390
  }
1391
1391
  if (destExists && destIsEmpty) {
1392
1392
  const emptyDirGit = createSafeGit(destPath, sessionId);
1393
- await emptyDirGit.raw(["-c", "credential.helper=", "clone", authUrl, "."]);
1393
+ await emptyDirGit.raw(["-c", "credential.helper=", "clone", "--progress", authUrl, "."]);
1394
1394
  try {
1395
1395
  await createSafeGit(void 0, sessionId).raw(["config", "--global", "--add", "safe.directory", destPath]);
1396
1396
  } catch (e) {
@@ -1405,7 +1405,7 @@ async function cloneRepository(sessionId, remoteUrl, destPath) {
1405
1405
  const baseDir = path__namespace.dirname(destPath);
1406
1406
  const targetDirName = path__namespace.basename(destPath);
1407
1407
  const parentGit = createSafeGit(baseDir, sessionId);
1408
- await parentGit.raw(["-c", "credential.helper=", "clone", authUrl, targetDirName]);
1408
+ await parentGit.raw(["-c", "credential.helper=", "clone", "--progress", authUrl, targetDirName]);
1409
1409
  try {
1410
1410
  await createSafeGit(void 0, sessionId).raw(["config", "--global", "--add", "safe.directory", destPath]);
1411
1411
  } catch (e) {
@@ -1426,6 +1426,16 @@ async function cloneRepository(sessionId, remoteUrl, destPath) {
1426
1426
  throw new Error(cleanMsg);
1427
1427
  }
1428
1428
  }
1429
+ async function removeGitMetadata(_sessionId, repoPath) {
1430
+ try {
1431
+ const gitDir = path__namespace.join(repoPath, ".git");
1432
+ await fs__namespace.rm(gitDir, { recursive: true, force: true });
1433
+ return true;
1434
+ } catch (e) {
1435
+ console.error("Failed to remove git metadata:", e);
1436
+ return false;
1437
+ }
1438
+ }
1429
1439
  const SYSTEM_PROMPT = `You are an autonomous Git Healer Agent for the "GitElectron" app.
1430
1440
  The user has encountered a Git error during a push, pull, or merge operation and you are executing as a background process to silently fix it.
1431
1441
  You will receive the Git Status and the Raw Error Message.
@@ -2068,6 +2078,17 @@ electron.app.whenReady().then(async () => {
2068
2078
  return await commitChanges(event.sender.id, message);
2069
2079
  });
2070
2080
  electron.ipcMain.handle("push-to-remote", async (event, remote, branch) => {
2081
+ const status = await getStatus(event.sender.id);
2082
+ if (status.isMassive) {
2083
+ return await pushMassiveRepository(
2084
+ event.sender.id,
2085
+ remote,
2086
+ branch,
2087
+ 5e3,
2088
+ void 0,
2089
+ (data) => event.sender.send("massive-push-progress", data)
2090
+ );
2091
+ }
2071
2092
  return await pushToRemote(event.sender.id, remote, branch);
2072
2093
  });
2073
2094
  electron.ipcMain.handle("pull-from-remote", async (event, remote, branch) => {
@@ -2257,6 +2278,9 @@ electron.app.whenReady().then(async () => {
2257
2278
  electron.ipcMain.handle("clone-repository", async (event, remoteUrl, destPath) => {
2258
2279
  return await cloneRepository(event.sender.id, remoteUrl, destPath);
2259
2280
  });
2281
+ electron.ipcMain.handle("remove-git-metadata", async (event, repoPath) => {
2282
+ return await removeGitMetadata(event.sender.id, repoPath);
2283
+ });
2260
2284
  electron.ipcMain.handle("check-path-exists", async (_event, targetPath) => {
2261
2285
  if (!targetPath) return false;
2262
2286
  try {
@@ -13,6 +13,7 @@ const api = {
13
13
  selectDirectory: () => electron.ipcRenderer.invoke("select-directory"),
14
14
  setRepoPath: (path) => electron.ipcRenderer.invoke("set-repo-path", path),
15
15
  initRepo: (path) => electron.ipcRenderer.invoke("init-repo", path),
16
+ removeGitMetadata: (repoPath) => electron.ipcRenderer.invoke("remove-git-metadata", repoPath),
16
17
  getStatus: () => electron.ipcRenderer.invoke("get-status"),
17
18
  stageFiles: (files) => electron.ipcRenderer.invoke("stage-files", files),
18
19
  unstageFiles: (files) => electron.ipcRenderer.invoke("unstage-files", files),