mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-16 15:21:56 +00:00
LibDiff: Add Diff::write_context_header
This is used to write a context patch header.
This commit is contained in:
parent
f02cf2704c
commit
44f141dd24
Notes:
sideshowbarker
2024-07-18 02:47:59 +09:00
Author: https://github.com/shannonbooth
Commit: 44f141dd24
Pull-request: https://github.com/SerenityOS/serenity/pull/19766
2 changed files with 9 additions and 0 deletions
|
@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue