Skip to content

Commit e3e023a

Browse files
committed
fix: use correct typings for git_merge_file_flag_t
1 parent 2eb8c84 commit e3e023a

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

Diff for: libgit2-sys/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1357,7 +1357,7 @@ pub struct git_merge_file_options {
13571357
pub our_label: *const c_char,
13581358
pub their_label: *const c_char,
13591359
pub favor: git_merge_file_favor_t,
1360-
pub flags: u32,
1360+
pub flags: git_merge_file_flag_t,
13611361
pub marker_size: c_ushort,
13621362
}
13631363

Diff for: src/merge.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ impl MergeFileOptions {
280280
self
281281
}
282282

283-
fn flag(&mut self, opt: u32, val: bool) -> &mut MergeFileOptions {
283+
fn flag(&mut self, opt: raw::git_merge_file_flag_t, val: bool) -> &mut MergeFileOptions {
284284
if val {
285285
self.raw.flags |= opt;
286286
} else {
@@ -291,52 +291,52 @@ impl MergeFileOptions {
291291

292292
/// Create standard conflicted merge files
293293
pub fn style_standard(&mut self, standard: bool) -> &mut MergeFileOptions {
294-
self.flag(raw::GIT_MERGE_FILE_STYLE_MERGE as u32, standard)
294+
self.flag(raw::GIT_MERGE_FILE_STYLE_MERGE, standard)
295295
}
296296

297297
/// Create diff3-style file
298298
pub fn style_diff3(&mut self, diff3: bool) -> &mut MergeFileOptions {
299-
self.flag(raw::GIT_MERGE_FILE_STYLE_DIFF3 as u32, diff3)
299+
self.flag(raw::GIT_MERGE_FILE_STYLE_DIFF3, diff3)
300300
}
301301

302302
/// Condense non-alphanumeric regions for simplified diff file
303303
pub fn simplify_alnum(&mut self, simplify: bool) -> &mut MergeFileOptions {
304-
self.flag(raw::GIT_MERGE_FILE_SIMPLIFY_ALNUM as u32, simplify)
304+
self.flag(raw::GIT_MERGE_FILE_SIMPLIFY_ALNUM, simplify)
305305
}
306306

307307
/// Ignore all whitespace
308308
pub fn ignore_whitespace(&mut self, ignore: bool) -> &mut MergeFileOptions {
309-
self.flag(raw::GIT_MERGE_FILE_IGNORE_WHITESPACE as u32, ignore)
309+
self.flag(raw::GIT_MERGE_FILE_IGNORE_WHITESPACE, ignore)
310310
}
311311

312312
/// Ignore changes in amount of whitespace
313313
pub fn ignore_whitespace_change(&mut self, ignore: bool) -> &mut MergeFileOptions {
314-
self.flag(raw::GIT_MERGE_FILE_IGNORE_WHITESPACE_CHANGE as u32, ignore)
314+
self.flag(raw::GIT_MERGE_FILE_IGNORE_WHITESPACE_CHANGE, ignore)
315315
}
316316

317317
/// Ignore whitespace at end of line
318318
pub fn ignore_whitespace_eol(&mut self, ignore: bool) -> &mut MergeFileOptions {
319-
self.flag(raw::GIT_MERGE_FILE_IGNORE_WHITESPACE_EOL as u32, ignore)
319+
self.flag(raw::GIT_MERGE_FILE_IGNORE_WHITESPACE_EOL, ignore)
320320
}
321321

322322
/// Use the "patience diff" algorithm
323323
pub fn patience(&mut self, patience: bool) -> &mut MergeFileOptions {
324-
self.flag(raw::GIT_MERGE_FILE_DIFF_PATIENCE as u32, patience)
324+
self.flag(raw::GIT_MERGE_FILE_DIFF_PATIENCE, patience)
325325
}
326326

327327
/// Take extra time to find minimal diff
328328
pub fn minimal(&mut self, minimal: bool) -> &mut MergeFileOptions {
329-
self.flag(raw::GIT_MERGE_FILE_DIFF_MINIMAL as u32, minimal)
329+
self.flag(raw::GIT_MERGE_FILE_DIFF_MINIMAL, minimal)
330330
}
331331

332332
/// Create zdiff3 ("zealous diff3")-style files
333333
pub fn style_zdiff3(&mut self, zdiff3: bool) -> &mut MergeFileOptions {
334-
self.flag(raw::GIT_MERGE_FILE_STYLE_ZDIFF3 as u32, zdiff3)
334+
self.flag(raw::GIT_MERGE_FILE_STYLE_ZDIFF3, zdiff3)
335335
}
336336

337337
/// Do not produce file conflicts when common regions have changed
338338
pub fn accept_conflicts(&mut self, accept: bool) -> &mut MergeFileOptions {
339-
self.flag(raw::GIT_MERGE_FILE_ACCEPT_CONFLICTS as u32, accept)
339+
self.flag(raw::GIT_MERGE_FILE_ACCEPT_CONFLICTS, accept)
340340
}
341341

342342
/// The size of conflict markers (eg, "<<<<<<<"). Default is 7.

0 commit comments

Comments
 (0)