Skip to content

Commit 1c58a4d

Browse files
committed
fix(publish): filter path_set with type R
fix #277
1 parent 7481aad commit 1c58a4d

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/diff-tree.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ const GIT_DIFF_TREE_TYPES = {
1313
FILE_STATS: 'stats',
1414
NO_SHOW: 'noshow'
1515
}
16+
17+
const PATCH_SET_TYPES = {
18+
ADD: 'A',
19+
MODIFY: 'M',
20+
DELETE: 'D',
21+
RENAME: 'R'
22+
}
1623
/**
1724
* @param {string} basedir -
1825
* @param {string} rev -
@@ -34,7 +41,10 @@ const getCommitPatchSet = (basedir, rev = 'HEAD') => {
3441
* @param {GitDiffTreeData} data -
3542
*/
3643
(type, data) => {
37-
if (type === GIT_DIFF_TREE_TYPES.RAW_DATA) {
44+
if (
45+
type === GIT_DIFF_TREE_TYPES.RAW_DATA &&
46+
data.status !== PATCH_SET_TYPES.RENAME
47+
) {
3848
patchSet.push({ path: data.toFile, type: data.status })
3949
}
4050
}

src/types.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ export interface Config {
2929
export enum PATCH_SET_TYPES {
3030
ADD = 'A',
3131
MODIFY = 'M',
32-
DELETE = 'D'
32+
DELETE = 'D',
33+
RENAME = 'R'
3334
}
3435

3536
export enum GIT_DIFF_TREE_TYPES {

0 commit comments

Comments
 (0)