Move the fname inside the unified diff block

This commit is contained in:
Paul Gauthier 2023-06-22 11:44:54 -07:00
parent 5043397848
commit b5a92896ab
2 changed files with 4 additions and 3 deletions

View file

@ -33,7 +33,7 @@ def create_progress_bar(percentage):
return bar
def diff_partial_update(lines_orig, lines_updated, final=False):
def diff_partial_update(lines_orig, lines_updated, final=False, fname=None):
"""
Given only the first part of an updated file, show the diff while
ignoring the block of "deleted" lines that are past the end of the
@ -72,6 +72,8 @@ def diff_partial_update(lines_orig, lines_updated, final=False):
diff += "\n"
show = "```diff\n"
if fname:
show += f"@@ {fname}\n"
if not final:
show += bar