╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Events.zig ───────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
877 const local_oid = try repo.readRef(io, evt.events_ref); 878 const remote_oid = try repo.readRef(io, remote_ref); 879 if (local_oid == null and remote_oid == null) { 880 try evt.consume(.local, .repo, repo_kind, repo_opts, io, allocator, repo, evt.events_ref, &.{}); 881 return null; 882 } 883 if (remote_oid != null) try evt.mergeEvents(repo_kind, repo_opts, io, allocator, repo, remote_ref); 884 try evt.consume(.local, .repo, repo_kind, repo_opts, io, allocator, repo, evt.events_ref, &.{}); 885 886 const push_refspec = try allocator.print("refs/heads/{s}:refs/heads/{s}", .{ evt.events_ref.name, evt.events_ref.name }); 887 defer allocator.free(push_refspec); 888 message.clearRetainingCapacity(); 889 repo.push(io, allocator, remote_name, push_refspec, false, push_transport_opts) catch |err| { 890 if (err == error.ServerReportedError and message.written().len != 0) return try allocator.dupe(u8, message.written()); 891 return err; 892 }; 893 message.clearRetainingCapacity(); 894 repo.fetch(io, allocator, remote_name, fetch_opts) catch |err| { 895 if (err == error.ServerReportedError and message.written().len != 0) return try allocator.dupe(u8, message.written()); 896 return err; 897 }; 898 }, 899 } 900 }, 901 } 902 return null; 903 } 904