@@ -116,7 +116,7 @@ def __init__(
116
116
options .append ("unstaged" )
117
117
118
118
# Branch is always present, so use as basis for name
119
- name = "{ }...HEAD". format ( compare_branch )
119
+ name = f" { compare_branch } ...HEAD"
120
120
if len (options ) > 0 :
121
121
# If more options are present separate them by comma's, except the last one
122
122
for item in options [:- 1 ]:
@@ -319,7 +319,7 @@ def _parse_source_sections(self, diff_str):
319
319
# We tolerate other information before we have
320
320
# a source file defined, unless it's a hunk line
321
321
if line .startswith ("@@" ):
322
- msg = "Hunk has no source file: '{}'" . format ( line )
322
+ msg = f "Hunk has no source file: '{ line } '"
323
323
raise GitDiffError (msg )
324
324
325
325
return source_dict
@@ -404,7 +404,7 @@ def _parse_source_line(self, line):
404
404
elif "--cc" in line :
405
405
regex = self .MERGE_CONFLICT_RE
406
406
else :
407
- msg = "Do not recognize format of source in line '{}'" . format ( line )
407
+ msg = f "Do not recognize format of source in line '{ line } '"
408
408
raise GitDiffError (msg )
409
409
410
410
# Parse for the source file path
@@ -414,7 +414,7 @@ def _parse_source_line(self, line):
414
414
return groups [0 ]
415
415
416
416
else :
417
- msg = "Could not parse source path in line '{}'" . format ( line )
417
+ msg = f "Could not parse source path in line '{ line } '"
418
418
raise GitDiffError (msg )
419
419
420
420
def _parse_hunk_line (self , line ):
@@ -455,11 +455,11 @@ def _parse_hunk_line(self, line):
455
455
raise GitDiffError (msg )
456
456
457
457
else :
458
- msg = "Could not find start of hunk in line '{}'" . format ( line )
458
+ msg = f "Could not find start of hunk in line '{ line } '"
459
459
raise GitDiffError (msg )
460
460
461
461
else :
462
- msg = "Could not parse hunk in line '{}'" . format ( line )
462
+ msg = f "Could not parse hunk in line '{ line } '"
463
463
raise GitDiffError (msg )
464
464
465
465
@staticmethod
0 commit comments