Skip to content

Commit

Permalink
Allow builds from 'git archive' generated tarballs
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed May 15, 2024
1 parent d6ab753 commit 53cdd8a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Added
* enable builds from `git archive` generated source tarballs [[@alerque](https://github.com/alerque)] ([#2187](https://github.com/extrawurst/gitui/pull/2187))

## [0.26.0+1] - 2024-04-14

**0.26.1**
Expand Down
7 changes: 6 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
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();
Expand Down

0 comments on commit 53cdd8a

Please sign in to comment.