refactor: move git status request to project_manager
This commit is contained in:
parent
1e998c12e4
commit
3e4a604739
5 changed files with 158 additions and 104 deletions
21
src/VcsStatus.zig
Normal file
21
src/VcsStatus.zig
Normal 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");
|
||||
Loading…
Add table
Add a link
Reference in a new issue