╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Events.zig ───────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
776 fetch_opts.refspecs = &.{fetch_refspec}; 777 message.clearRetainingCapacity(); 778 repo.fetch(io, allocator, remote_name, fetch_opts) catch |err| { 779 if (err == error.ServerReportedError and message.written().len != 0) return try allocator.dupe(u8, message.written()); 780 return err; 781 }; 782 783 const remote_ref: rf.Ref = .{ .kind = .{ .remote = remote_name }, .name = evt.events_ref.name }; 784 const local_oid = try repo.readRef(io, evt.events_ref); 785 const remote_oid = try repo.readRef(io, remote_ref); 786 if (local_oid == null and remote_oid == null) { 787 try evt.consume(.repo, repo_kind, repo_opts, io, allocator, repo, evt.events_ref, &.{}); 788 return null; 789 } 790 if (remote_oid != null) try evt.mergeEvents(repo_kind, repo_opts, io, allocator, repo, remote_ref); 791 try evt.consume(.repo, repo_kind, repo_opts, io, allocator, repo, evt.events_ref, &.{}); 792 793 const push_refspec = try std.fmt.allocPrint(allocator, "refs/heads/{s}:refs/heads/{s}", .{ evt.events_ref.name, evt.events_ref.name }); 794 defer allocator.free(push_refspec); 795 message.clearRetainingCapacity(); 796 repo.push(io, allocator, remote_name, push_refspec, false, push_transport_opts) catch |err| { 797 if (err == error.ServerReportedError and message.written().len != 0) return try allocator.dupe(u8, message.written()); 798 return err; 799 }; 800 message.clearRetainingCapacity(); 801 repo.fetch(io, allocator, remote_name, fetch_opts) catch |err| { 802 if (err == error.ServerReportedError and message.written().len != 0) return try allocator.dupe(u8, message.written()); 803 return err; 804 }; 805 }, 806 } 807 }, 808 } 809 return null; 810 } 811