Skip to content

Commit 23434de

Browse files
chore: GitContext long hash & idiomatic Options (#233)
* chore: GitContext long hash & idiomatic Options * chore: adds regression tests for GitContext * fix: use git2 to construct GitContext
1 parent 211cfac commit 23434de

File tree

5 files changed

+203
-111
lines changed

5 files changed

+203
-111
lines changed

.github/workflows/test.yml

+1-6
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,7 @@ jobs:
99
runs-on: ${{ matrix.os }}
1010
strategy:
1111
matrix:
12-
build:
13-
[
14-
linux-stable,
15-
macos-stable,
16-
windows-stable,
17-
]
12+
build: [linux-stable, macos-stable, windows-stable]
1813
include:
1914
- build: linux-stable
2015
os: ubuntu-latest

Cargo.lock

+72-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+4-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ timber = { path = "./crates/timber" }
1919
anyhow = "1.0.38"
2020
atty = "0.2.14"
2121
ansi_term = "0.12.1"
22+
chrono = "0.4"
2223
console = "0.14.0"
24+
git2 = "0.13.17"
25+
git-url-parse = "0.3.1"
2326
heck = "0.3.2"
2427
prettytable-rs = "0.8.0"
2528
serde = "1.0"
@@ -28,13 +31,11 @@ structopt = "0.3.21"
2831
tracing = "0.1.22"
2932
regex = "1"
3033
url = "2.2.0"
31-
git_info = "0.1.2"
32-
git-url-parse = "0.3.1"
33-
chrono = "0.4"
3434

3535
[dev-dependencies]
3636
assert_cmd = "1.0.1"
3737
assert_fs = "1.0.0"
38+
rustversion = "1.0.4"
3839
serial_test = "0.5.0"
3940
predicates = "1.0.5"
4041

src/cli.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ impl Rover {
7575

7676
pub(crate) fn get_git_context(&self) -> Result<GitContext> {
7777
// constructing GitContext with a set of overrides from env vars
78-
let git_context = GitContext::with_env(&self.env_store)?;
78+
let git_context = GitContext::try_from_rover_env(&self.env_store)?;
7979
tracing::debug!(?git_context);
8080
Ok(git_context)
8181
}

0 commit comments

Comments
 (0)