Skip to content

Commit d1ebc56

Browse files
alerqueextrawurst
andauthored
Allow builds from 'git archive' generated tarballs (#2187)
Co-authored-by: extrawurst <[email protected]>
1 parent a085add commit d1ebc56

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Diff for: CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ but this also allows us now to define colors in the common hex format:
2323

2424
Checkout [THEMES.md](./THEMES.md) for more info.
2525

26+
### Added
27+
* support `TAR_COMMIT_ID` enabling builds from `git archive` generated source tarballs or other outside a git repo [[@alerque](https://github.com/alerque)] ([#2187](https://github.com/extrawurst/gitui/pull/2187))
28+
2629
### Fixes
2730
* update yanked dependency to `libc` to fix building with `--locked`.
2831
* document breaking change in theme file format.

Diff for: build.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@ use chrono::TimeZone;
33
fn get_git_hash() -> String {
44
use std::process::Command;
55

6+
// Allow builds from `git archive` generated tarballs if output of `git get-tar-commit-id` is
7+
// set in an env var.
8+
if let Ok(commit) = std::env::var("TAR_COMMIT_ID") {
9+
return commit[..7].to_string();
10+
};
611
let commit = Command::new("git")
712
.arg("rev-parse")
8-
.arg("--short")
13+
.arg("--short=7")
914
.arg("--verify")
1015
.arg("HEAD")
1116
.output();

0 commit comments

Comments
 (0)