@harryisfish/gitt 1.6.5 → 1.6.6

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.
@@ -23,25 +23,21 @@ async function cleanDeletedBranches(options = {}) {
23
23
  // Phase 1: Discovery
24
24
  const discoveryTasks = new listr2_1.Listr([
25
25
  {
26
- title: 'Switch to main branch',
26
+ title: 'Fetch and switch to main branch',
27
27
  task: async (ctx) => {
28
28
  const mainBranch = await (0, git_1.getMainBranch)();
29
29
  ctx.mainBranch = mainBranch;
30
30
  const branchInfo = await git.branchLocal();
31
31
  ctx.currentBranch = branchInfo.current;
32
- // Always switch to main branch first
32
+ // Fetch main branch first to avoid conflicts
33
+ await git.fetch(['origin', mainBranch]);
34
+ // Switch to main branch if not already on it
33
35
  if (ctx.currentBranch !== mainBranch) {
34
36
  await git.checkout(mainBranch);
35
37
  await git.pull();
36
38
  }
37
39
  }
38
40
  },
39
- {
40
- title: 'Fetch from remote',
41
- task: async (ctx) => {
42
- await git.fetch(['origin', ctx.mainBranch]);
43
- }
44
- },
45
41
  {
46
42
  title: 'Analyze branches',
47
43
  task: async (ctx) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harryisfish/gitt",
3
- "version": "1.6.5",
3
+ "version": "1.6.6",
4
4
  "description": "A command-line tool to help you manage Git repositories and remote repositories, such as keeping in sync, pushing, pulling, etc.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {