refactor: move git status request to project_manager

This commit is contained in:
CJ van den Berg 2025-10-28 21:27:48 +01:00
parent 1e998c12e4
commit 3e4a604739
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
5 changed files with 158 additions and 104 deletions

21
src/VcsStatus.zig Normal file
View file

@ -0,0 +1,21 @@
branch: ?[]const u8 = null,
ahead: ?[]const u8 = null,
behind: ?[]const u8 = null,
stash: ?[]const u8 = null,
changed: usize = 0,
untracked: usize = 0,
pub fn reset(self: *@This(), allocator: std.mem.Allocator) void {
if (self.branch) |p| allocator.free(p);
if (self.ahead) |p| allocator.free(p);
if (self.behind) |p| allocator.free(p);
if (self.stash) |p| allocator.free(p);
self.branch = null;
self.ahead = null;
self.behind = null;
self.stash = null;
self.changed = 0;
self.untracked = 0;
}
const std = @import("std");