Skip to content

Commit 4c3d260

Browse files
Vikram KaltaVikram Kalta
authored andcommitted
fix: fixed ignore item for modified and deleted groups
1 parent 573de1f commit 4c3d260

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

packages/contentstack-branches/src/branch/merge-handler.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ export default class MergeHandler {
108108
deleted: [],
109109
};
110110
const selectedItems = await selectCustomPreferences(module, this.branchCompareData[module]);
111+
if (!selectedItems.length) {
112+
cliux.print(chalk.red('No items were selected'));
113+
process.exit(1);
114+
}
111115
forEach(selectedItems, (item) => {
112116
this.mergeSettings.mergeContent[module][item.status].push(item.value);
113117
this.mergeSettings.itemMergeStrategies.push(item.value);

packages/contentstack-branches/src/utils/branch-diff-utility.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,15 @@ function printCompactTextView(branchTextRes: BranchCompactTextRes): void {
202202
});
203203

204204
forEach(branchTextRes.modified, (diff: BranchDiffRes) => {
205-
cliux.print(chalk.blue(`± '${diff.title}' ${startCase(camelCase(diff.type))}`));
205+
if (diff.merge_strategy !== 'ignore') {
206+
cliux.print(chalk.blue(`± '${diff.title}' ${startCase(camelCase(diff.type))}`));
207+
}
206208
});
207209

208210
forEach(branchTextRes.deleted, (diff: BranchDiffRes) => {
209-
cliux.print(chalk.red(`- '${diff.title}' ${startCase(camelCase(diff.type))}`));
211+
if (diff.merge_strategy !== 'ignore') {
212+
cliux.print(chalk.red(`- '${diff.title}' ${startCase(camelCase(diff.type))}`));
213+
}
210214
});
211215
}
212216
}

0 commit comments

Comments
 (0)