Skip to content

Commit

Permalink
[BETA] Fix cargo new in root directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Jul 12, 2019
1 parent 4c1fa54 commit 2f12ab6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cargo/ops/cargo_new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,10 @@ fn init_vcs(path: &Path, vcs: VersionControl, config: &Config) -> CargoResult<()
match vcs {
VersionControl::Git => {
if !path.join(".git").exists() {
// Temporary fix to work around bug in libgit2 when creating a
// directory in the root of a posix filesystem.
// See: https://github.com/libgit2/libgit2/issues/5130
fs::create_dir_all(path)?;
GitRepo::init(path, config.cwd())?;
}
}
Expand Down

0 comments on commit 2f12ab6

Please sign in to comment.