srctree

Gregory Mullen parent 70ef96c3 35e6b0bb
don't doxx repos by default

inlinesplit
src/git/remote.zig added: 5, removed: 3, total 2
@@ -2,6 +2,7 @@ const std = @import("std");
const eql = std.mem.eql;
const startsWith = std.mem.startsWith;
const endsWith = std.mem.endsWith;
 
pub const Remote = @This();
@@ -15,8 +16,9 @@ pub fn format(r: Remote, comptime fmt: []const u8, _: std.fmt.FormatOptions, out
var printable = url;
if (startsWith(u8, printable, "https://")) {
printable = printable[8..];
} else if (startsWith(u8, printable, "git@")) {
printable = printable[4..];
 
}
if (endsWith(u8, printable, ".git")) {
printable = printable[0 .. printable.len - 4];
@@ -2,6 +2,7 @@ const std = @import("std");
const eql = std.mem.eql;
const startsWith = std.mem.startsWith;
const endsWith = std.mem.endsWith;
const indexOf = std.mem.indexOf;
pub const Remote = @This();
@@ -15,8 +16,9 @@ pub fn format(r: Remote, comptime fmt: []const u8, _: std.fmt.FormatOptions, out
var printable = url;
if (startsWith(u8, printable, "https://")) {
printable = printable[8..];
}
if (indexOf(u8, printable, "@")) |i| {
printable = printable[i + 1 ..];
}
if (endsWith(u8, printable, ".git")) {
printable = printable[0 .. printable.len - 4];