mirror of
https://github.com/gitui-org/gitui
synced 2026-05-22 16:38:28 +00:00
Allow builds from 'git archive' generated tarballs (#2187)
Co-authored-by: extrawurst <776816+extrawurst@users.noreply.github.com>
This commit is contained in:
parent
a085add733
commit
d1ebc56bfe
2 changed files with 9 additions and 1 deletions
|
|
@ -23,6 +23,9 @@ but this also allows us now to define colors in the common hex format:
|
|||
|
||||
Checkout [THEMES.md](./THEMES.md) for more info.
|
||||
|
||||
### Added
|
||||
* 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))
|
||||
|
||||
### Fixes
|
||||
* update yanked dependency to `libc` to fix building with `--locked`.
|
||||
* document breaking change in theme file format.
|
||||
|
|
|
|||
7
build.rs
7
build.rs
|
|
@ -3,9 +3,14 @@ use chrono::TimeZone;
|
|||
fn get_git_hash() -> String {
|
||||
use std::process::Command;
|
||||
|
||||
// Allow builds from `git archive` generated tarballs if output of `git get-tar-commit-id` is
|
||||
// set in an env var.
|
||||
if let Ok(commit) = std::env::var("TAR_COMMIT_ID") {
|
||||
return commit[..7].to_string();
|
||||
};
|
||||
let commit = Command::new("git")
|
||||
.arg("rev-parse")
|
||||
.arg("--short")
|
||||
.arg("--short=7")
|
||||
.arg("--verify")
|
||||
.arg("HEAD")
|
||||
.output();
|
||||
|
|
|
|||
Loading…
Reference in a new issue