From 256ac9c8eb8775acd1f812ee4345e13926181f0e Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Thu, 12 Aug 2021 11:24:06 +0000 Subject: Find repository --- src/main.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index e7a11a9..062a448 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,16 @@ +// SPDX-License-Identifier: EUPL-1.2 +// SPDX-FileCopyrightText: 2021 Alyssa Ross + +use std::process::exit; + +use git2::Repository; + fn main() { - println!("Hello, world!"); + let repo = match Repository::open_from_env() { + Ok(repo) => repo, + Err(e) => { + eprintln!("fatal: {}", e.message()); + exit(128); + } + }; } -- cgit 1.4.1