Compare commits

..

No commits in common. "master" and "v6.1" have entirely different histories.
master ... v6.1

3 changed files with 3 additions and 23 deletions

5
XD.1
View file

@ -26,7 +26,6 @@ tab(;) allbox;
c;l. c;l.
:;default :;default
\;;in a git repo \;;in a git repo
=;in a git repo during a bisect
8;in a git repo with stashed changes 8;in a git repo with stashed changes
X;in a git repo during a merge X;in a git repo during a merge
O;in a git repo during a rebase O;in a git repo during a rebase
@ -57,8 +56,8 @@ c;l.
returns the number that was passed in to allow the user to re-run the program returns the number that was passed in to allow the user to re-run the program
and get the same results. If there's an internal error and get the same results. If there's an internal error
.Nm .Nm
returns 1. If you wish to find out more infomation about the error pass in returns 1. If you wish to find out more infomation about the error enable ERR
-Derr at build time. in the config.mk.
.Sh OPTIONS .Sh OPTIONS
.Ss -v .Ss -v
Print version information to stdout and exit. Print version information to stdout and exit.

View file

@ -114,20 +114,6 @@ pub fn inRebase(self: *Git) bool {
}; };
} }
pub fn inBisect(self: *Git) bool {
const s = perf.s();
defer perf.e(s, @src());
const path = std.fs.path.join(self.allocator, &[_][]const u8{
std.mem.span(self.git_path.ptr),
"BISECT_LOG",
}) catch return false;
defer self.allocator.free(path);
std.fs.cwd().access(path, .{ .mode = .read_only }) catch return false;
return true;
}
pub fn hasStaged(self: *Git) bool { pub fn hasStaged(self: *Git) bool {
const s = perf.s(); const s = perf.s();
defer perf.e(s, @src()); defer perf.e(s, @src());

View file

@ -59,12 +59,7 @@ pub fn main() u8 {
var git = if (config.git) try @import("Git.zig").init(allocator) orelse null; var git = if (config.git) try @import("Git.zig").init(allocator) orelse null;
defer if (config.git and git != null) git.?.deinit(); defer if (config.git and git != null) git.?.deinit();
if (config.git and git != null) { if (config.git and git != null) {
if (git.?.inBisect()) { if (git.?.hasStashes()) {
face[@intFromEnum(FaceParts.eyes)] = .{
.symbol = '=',
.explanation = "The current git repo is bisecting.",
};
} else if (git.?.hasStashes()) {
face[@intFromEnum(FaceParts.eyes)] = .{ face[@intFromEnum(FaceParts.eyes)] = .{
.symbol = '8', .symbol = '8',
.explanation = "The current git repo has stashed changes.", .explanation = "The current git repo has stashed changes.",