Skip to content

Commit 04bf807

Browse files
committed
add comments
1 parent 3a5169d commit 04bf807

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

git-repository/examples/init-non-bare-repo.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
// cargo run -p git-repository --example new
1+
// creates a repo with user-specified path (which must not exist)
2+
// adds initial commit with empty tree
23

34
use anyhow::Context;
45
use git_repository as git;
56

67
fn main() -> anyhow::Result<()> {
8+
// Note use of args_os:
9+
// paths may not be UTF-8 encoded and thus can't be forced into a String.
10+
// gitoxide does not assume encodings that aren't there
11+
// to match the way git does it as a bare minimum and be just as flexible.
712
let work_dir = std::env::args_os()
813
.nth(1)
914
.context("First argument needs to be the directory to initialize the repository in")?;

0 commit comments

Comments
 (0)