@@ -9,9 +9,9 @@ rename from old-file.ts
9
9
rename to new-file.ts` ;
10
10
11
11
const result = parseGitDiff ( diffContent ) ;
12
-
12
+
13
13
assert . strictEqual ( result . files . length , 1 , 'Should parse one file' ) ;
14
-
14
+
15
15
const file = result . files [ 0 ] ;
16
16
assert . strictEqual ( file . path , 'new-file.ts' , 'Should have correct new path' ) ;
17
17
assert . strictEqual ( file . originalPath , 'old-file.ts' , 'Should have correct original path' ) ;
@@ -27,9 +27,9 @@ index 0000000..abc123
27
27
+++ b/new-file.ts` ;
28
28
29
29
const result = parseGitDiff ( diffContent ) ;
30
-
30
+
31
31
assert . strictEqual ( result . files . length , 1 , 'Should parse one file' ) ;
32
-
32
+
33
33
const file = result . files [ 0 ] ;
34
34
assert . strictEqual ( file . path , 'new-file.ts' , 'Should have correct path' ) ;
35
35
assert . strictEqual ( file . originalPath , undefined , 'Should have no original path' ) ;
@@ -45,9 +45,9 @@ index abc123..0000000
45
45
+++ /dev/null` ;
46
46
47
47
const result = parseGitDiff ( diffContent ) ;
48
-
48
+
49
49
assert . strictEqual ( result . files . length , 1 , 'Should parse one file' ) ;
50
-
50
+
51
51
const file = result . files [ 0 ] ;
52
52
assert . strictEqual ( file . path , 'dev/null' , 'Should have correct path' ) ;
53
53
assert . strictEqual ( file . originalPath , 'old-file.ts' , 'Should have correct original path' ) ;
@@ -61,9 +61,9 @@ old mode 100644
61
61
new mode 100755` ;
62
62
63
63
const result = parseGitDiff ( diffContent ) ;
64
-
64
+
65
65
assert . strictEqual ( result . files . length , 1 , 'Should parse one file' ) ;
66
-
66
+
67
67
const file = result . files [ 0 ] ;
68
68
assert . strictEqual ( file . path , 'script.sh' , 'Should have correct path' ) ;
69
69
assert . strictEqual ( file . originalPath , undefined , 'Should have no original path' ) ;
@@ -77,9 +77,9 @@ index abc123..def456 100644
77
77
Binary files a/image.png and b/image.png differ` ;
78
78
79
79
const result = parseGitDiff ( diffContent ) ;
80
-
80
+
81
81
assert . strictEqual ( result . files . length , 1 , 'Should parse one file' ) ;
82
-
82
+
83
83
const file = result . files [ 0 ] ;
84
84
assert . strictEqual ( file . path , 'image.png' , 'Should have correct path' ) ;
85
85
assert . strictEqual ( file . originalPath , undefined , 'Should have no original path' ) ;
@@ -99,9 +99,9 @@ index abc123..def456 100644
99
99
line 3` ;
100
100
101
101
const result = parseGitDiff ( diffContent ) ;
102
-
102
+
103
103
assert . strictEqual ( result . files . length , 1 , 'Should parse one file' ) ;
104
-
104
+
105
105
const file = result . files [ 0 ] ;
106
106
assert . strictEqual ( file . path , 'file.ts' , 'Should have correct path' ) ;
107
107
assert . strictEqual ( file . originalPath , undefined , 'Should have no original path' ) ;
@@ -124,16 +124,16 @@ index abc123..def456 100644
124
124
line 2` ;
125
125
126
126
const result = parseGitDiff ( diffContent ) ;
127
-
127
+
128
128
assert . strictEqual ( result . files . length , 2 , 'Should parse two files' ) ;
129
-
129
+
130
130
// First file (rename)
131
131
const renameFile = result . files [ 0 ] ;
132
132
assert . strictEqual ( renameFile . path , 'new-file.ts' , 'Should have correct new path' ) ;
133
133
assert . strictEqual ( renameFile . originalPath , 'old-file.ts' , 'Should have correct original path' ) ;
134
134
assert . strictEqual ( renameFile . status , 'R' , 'Should have rename status' ) ;
135
135
assert . strictEqual ( renameFile . hunks . length , 0 , 'Should have no hunks for pure rename' ) ;
136
-
136
+
137
137
// Second file (regular change)
138
138
const modifiedFile = result . files [ 1 ] ;
139
139
assert . strictEqual ( modifiedFile . path , 'regular-file.ts' , 'Should have correct path' ) ;
0 commit comments