43
43
from .config import Config
44
44
from .enums import (
45
45
AttrCheck ,
46
+ BlameFlag ,
46
47
BranchType ,
47
48
CheckoutStrategy ,
48
49
DiffOption ,
@@ -534,7 +535,7 @@ def state_cleanup(self):
534
535
#
535
536
# blame
536
537
#
537
- def blame (self , path , flags = None , min_match_characters = None ,
538
+ def blame (self , path , flags : BlameFlag = BlameFlag . NORMAL , min_match_characters = None ,
538
539
newest_commit = None , oldest_commit = None , min_line = None ,
539
540
max_line = None ):
540
541
"""
@@ -546,7 +547,7 @@ def blame(self, path, flags=None, min_match_characters=None,
546
547
Path to the file to blame.
547
548
548
549
flags
549
- A GIT_BLAME_* constant.
550
+ An enums.BlameFlag constant.
550
551
551
552
min_match_characters
552
553
The number of alphanum chars that must be detected as moving/copying
@@ -566,13 +567,13 @@ def blame(self, path, flags=None, min_match_characters=None,
566
567
567
568
Examples::
568
569
569
- repo.blame('foo.c', flags=GIT_BLAME_TRACK_COPIES_SAME_FILE )
570
+ repo.blame('foo.c', flags=enums.BlameFlag.IGNORE_WHITESPACE )
570
571
"""
571
572
572
573
options = ffi .new ('git_blame_options *' )
573
574
C .git_blame_options_init (options , C .GIT_BLAME_OPTIONS_VERSION )
574
575
if flags :
575
- options .flags = flags
576
+ options .flags = int ( flags )
576
577
if min_match_characters :
577
578
options .min_match_characters = min_match_characters
578
579
if newest_commit :
0 commit comments