diff --git a/.changes/unreleased/Fixed-20260604-205235.yaml b/.changes/unreleased/Fixed-20260604-205235.yaml new file mode 100644 index 0000000..247a008 --- /dev/null +++ b/.changes/unreleased/Fixed-20260604-205235.yaml @@ -0,0 +1,3 @@ +kind: Fixed +body: Working path was de-allocator before use. This cause the origins not to be configured correctly. This bug was introduced during the zig 0.16.0 upgrade. +time: 2026-06-04T20:52:35.308341822+01:00 diff --git a/src/root.zig b/src/root.zig index 05f032b..6ae51b6 100644 --- a/src/root.zig +++ b/src/root.zig @@ -237,7 +237,7 @@ pub fn linkGit(io: std.Io, path: std.Io.Dir) !void { pub fn setupOrigin(allocator: std.mem.Allocator, io: std.Io, path: std.Io.Dir) !void { const _path = try path.realPathFileAlloc(io, ".", allocator); - allocator.free(_path); + defer allocator.free(_path); const cmd = [_][]const u8{ "git", "-C", @@ -260,7 +260,7 @@ pub fn setupOrigin(allocator: std.mem.Allocator, io: std.Io, path: std.Io.Dir) ! pub fn fetchOrigin(allocator: std.mem.Allocator, io: std.Io, path: std.Io.Dir) !void { const _path = try path.realPathFileAlloc(io, ".", allocator); - allocator.free(_path); + defer allocator.free(_path); const cmd = [_][]const u8{ "git", "-C", _path, "fetch", "-p", "origin" }; const result = std.process.run(allocator, io, .{ .argv = &cmd,