Skip to content

Commit 7f99dc4

Browse files
committed
fix: allow get_version_info to succeed if git rev-parse fails
closes #167
1 parent 952a755 commit 7f99dc4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

build.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ fn gen_version_info(
597597
defer buf.deinit();
598598
try buf.appendSlice(branch);
599599
try buf.appendSlice("@{upstream}");
600-
break :blk try b.runAllowFail(&[_][]const u8{ "git", "rev-parse", "--abbrev-ref", buf.items }, &code, .Ignore);
600+
break :blk (b.runAllowFail(&[_][]const u8{ "git", "rev-parse", "--abbrev-ref", buf.items }, &code, .Ignore) catch "");
601601
};
602602
const tracking_remote_name = if (std.mem.indexOfScalar(u8, tracking_branch_, '/')) |pos| tracking_branch_[0..pos] else "";
603603
const tracking_remote_ = if (tracking_remote_name.len > 0) blk: {

0 commit comments

Comments
 (0)