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 {