@@ -249,6 +249,7 @@ internal class GitDiffLine
249
249
public int NewLineNo ;
250
250
public int NumLines ;
251
251
public UIntPtr contentLen ;
252
+ public Int64 contentOffset ;
252
253
public IntPtr content ;
253
254
}
254
255
@@ -274,4 +275,61 @@ enum GitDiffFormat
274
275
GIT_DIFF_FORMAT_NAME_ONLY = 4 , // < like git diff --name-only
275
276
GIT_DIFF_FORMAT_NAME_STATUS = 5 , // < like git diff --name-status
276
277
}
278
+
279
+ [ Flags ]
280
+ enum GitDiffFindFlags
281
+ {
282
+ GIT_DIFF_FIND_RENAMES = ( 1 << 0 ) ,
283
+ // consider old side of modified for renames? (`--break-rewrites=N`)
284
+ GIT_DIFF_FIND_RENAMES_FROM_REWRITES = ( 1 << 1 ) ,
285
+
286
+ // look for copies? (a la `--find-copies`)
287
+ GIT_DIFF_FIND_COPIES = ( 1 << 2 ) ,
288
+ // consider unmodified as copy sources? (`--find-copies-harder`)
289
+ GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED = ( 1 << 3 ) ,
290
+
291
+ // mark large rewrites for split (`--break-rewrites=/M`)
292
+ GIT_DIFF_FIND_REWRITES = ( 1 << 4 ) ,
293
+ // actually split large rewrites into delete/add pairs
294
+ GIT_DIFF_BREAK_REWRITES = ( 1 << 5 ) ,
295
+ // mark rewrites for split and break into delete/add pairs
296
+ GIT_DIFF_FIND_AND_BREAK_REWRITES =
297
+ ( GIT_DIFF_FIND_REWRITES | GIT_DIFF_BREAK_REWRITES ) ,
298
+
299
+ // find renames/copies for untracked items in working directory
300
+ GIT_DIFF_FIND_FOR_UNTRACKED = ( 1 << 6 ) ,
301
+
302
+ // turn on all finding features
303
+ GIT_DIFF_FIND_ALL = ( 0x0ff ) ,
304
+
305
+ // measure similarity ignoring leading whitespace (default)
306
+ GIT_DIFF_FIND_IGNORE_LEADING_WHITESPACE = 0 ,
307
+ // measure similarity ignoring all whitespace
308
+ GIT_DIFF_FIND_IGNORE_WHITESPACE = ( 1 << 12 ) ,
309
+ // measure similarity including all data
310
+ GIT_DIFF_FIND_DONT_IGNORE_WHITESPACE = ( 1 << 13 ) ,
311
+ // measure similarity only by comparing SHAs (fast and cheap)
312
+ GIT_DIFF_FIND_EXACT_MATCH_ONLY = ( 1 << 14 ) ,
313
+
314
+ // do not break rewrites unless they contribute to a rename
315
+ GIT_DIFF_BREAK_REWRITES_FOR_RENAMES_ONLY = ( 1 << 15 ) ,
316
+
317
+ // Remove any UNMODIFIED deltas after find_similar is done.
318
+ GIT_DIFF_FIND_REMOVE_UNMODIFIED = ( 1 << 16 ) ,
319
+ }
320
+
321
+ [ StructLayout ( LayoutKind . Sequential ) ]
322
+ internal class GitDiffFindOptions
323
+ {
324
+ public uint Version = 1 ;
325
+ public GitDiffFindFlags Flags ;
326
+ public UInt16 RenameThreshold ;
327
+ public UInt16 RenameFromRewriteThreshold ;
328
+ public UInt16 CopyThreshold ;
329
+ public UInt16 BreakRewriteThreshold ;
330
+ public UIntPtr RenameLimit ;
331
+
332
+ // TODO
333
+ public IntPtr SimilarityMetric ;
334
+ }
277
335
}
0 commit comments