mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibDiff: Add Diff::write_context_header
This is used to write a context patch header.
This commit is contained in:
committed by
Andreas Kling
parent
f02cf2704c
commit
44f141dd24
@@ -210,4 +210,12 @@ ErrorOr<void> write_context(Hunk const& hunk, Stream& stream, ColorOutput color_
|
||||
return write_hunk_as_context(split_lines.old_lines, split_lines.new_lines, hunk.location, stream, color_output);
|
||||
}
|
||||
|
||||
ErrorOr<void> write_context_header(StringView old_path, StringView new_path, Stream& stream)
|
||||
{
|
||||
TRY(stream.write_formatted("*** {}\n", old_path));
|
||||
TRY(stream.write_formatted("--- {}\n", new_path));
|
||||
|
||||
return stream.write_formatted("***************\n");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,4 +26,5 @@ ErrorOr<void> write_unified_header(StringView old_path, StringView new_path, Str
|
||||
ErrorOr<void> write_normal(Hunk const& hunk, Stream& stream, ColorOutput color_output = ColorOutput::No);
|
||||
|
||||
ErrorOr<void> write_context(Hunk const& hunk, Stream& stream, ColorOutput color_output = ColorOutput::No);
|
||||
ErrorOr<void> write_context_header(StringView old_path, StringView new_path, Stream& stream);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user