@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.
- package/dist/commands/clean.js +4 -8
- package/package.json +1 -1
package/dist/commands/clean.js
CHANGED
|
@@ -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: '
|
|
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
|
-
//
|
|
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