╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Events.zig ───────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
907 var fetch_opts = fetch_transport_opts; 908 fetch_opts.refspecs = &.{fetch_refspec}; 909 message.clearRetainingCapacity(); 910 repo.fetch(io, allocator, remote_name, fetch_opts) catch |err| { 911 if (err == error.ServerReportedError and message.written().len != 0) return try allocator.dupe(u8, message.written()); 912 return err; 913 }; 914 915 const remote_ref: rf.Ref = .{ .kind = .{ .remote = remote_name }, .name = evt.events_ref.name }; 916 const local_oid = try repo.readRef(io, evt.events_ref); 917 const remote_oid = try repo.readRef(io, remote_ref); 918 if (local_oid == null and remote_oid == null) { 919 try evt.consume(.local, .repo, repo_kind, repo_opts, io, allocator, repo, evt.events_ref, &.{}); 920 return null; 921 } 922 if (remote_oid != null) try evt.mergeEvents(repo_kind, repo_opts, io, allocator, repo, remote_ref); 923 try evt.consume(.local, .repo, repo_kind, repo_opts, io, allocator, repo, evt.events_ref, &.{}); 924 925 const push_refspec = try allocator.print("refs/heads/{s}:refs/heads/{s}", .{ evt.events_ref.name, evt.events_ref.name }); 926 defer allocator.free(push_refspec); 927 message.clearRetainingCapacity(); 928 repo.push(io, allocator, remote_name, push_refspec, false, push_transport_opts) catch |err| { 929 if (err == error.ServerReportedError and message.written().len != 0) return try allocator.dupe(u8, message.written()); 930 return err; 931 }; 932 message.clearRetainingCapacity(); 933 repo.fetch(io, allocator, remote_name, fetch_opts) catch |err| { 934 if (err == error.ServerReportedError and message.written().len != 0) return try allocator.dupe(u8, message.written()); 935 return err; 936 }; 937 }, 938 } 939 }, 940 } 941 return null; 942 } 943