refactor: fix error handling in git.rev_parse
This commit is contained in:
parent
5fd499d141
commit
79a184aa4a
1 changed files with 2 additions and 2 deletions
|
|
@ -273,9 +273,9 @@ pub fn rev_parse(context_: usize, rev: []const u8, file_path: []const u8) Error!
|
||||||
var arg: std.Io.Writer.Allocating = .init(allocator);
|
var arg: std.Io.Writer.Allocating = .init(allocator);
|
||||||
defer arg.deinit();
|
defer arg.deinit();
|
||||||
if (file_path.len == 0)
|
if (file_path.len == 0)
|
||||||
arg.writer.print("{s}", .{rev})
|
try arg.writer.print("{s}", .{rev})
|
||||||
else
|
else
|
||||||
arg.writer.print("{s}:{s}", .{ rev, file_path });
|
try arg.writer.print("{s}:{s}", .{ rev, file_path });
|
||||||
try git(context_, .{ "rev-parse", arg.written() }, struct {
|
try git(context_, .{ "rev-parse", arg.written() }, struct {
|
||||||
fn result(context: usize, parent: tp.pid_ref, output: []const u8) void {
|
fn result(context: usize, parent: tp.pid_ref, output: []const u8) void {
|
||||||
var it = std.mem.splitScalar(u8, output, '\n');
|
var it = std.mem.splitScalar(u8, output, '\n');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue