From c2909919bcf08e29e8261314d6b463bc8c60071a Mon Sep 17 00:00:00 2001 From: randymcmillan Date: Tue, 10 Sep 2024 08:58:35 -0400 Subject: [PATCH] gnostr-add:repo = match Repository::discover(.) --- bins/src/bin/gnostr-add.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bins/src/bin/gnostr-add.rs b/bins/src/bin/gnostr-add.rs index 9c90700ca8..ab6e7a64b6 100644 --- a/bins/src/bin/gnostr-add.rs +++ b/bins/src/bin/gnostr-add.rs @@ -37,7 +37,12 @@ struct Args { } fn run(args: &Args) -> Result<(), git2::Error> { - let repo = Repository::open(&Path::new("."))?; + let repo: Repository; + repo = match Repository::discover(".") { + Ok(repo) => repo, + Err(e) => panic!("failed to init: {}", e), + }; + let mut index = repo.index()?; let cb = &mut |path: &Path, _matched_spec: &[u8]| -> i32 {