Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions crates/uv/src/commands/project/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,10 @@ impl InitProjectKind {
) -> Result<()> {
fs_err::create_dir_all(path)?;

// Initialize the version control system first so that Git configuration can properly
// read conditional includes that depend on the repository path.
init_vcs(path, vcs)?;

// Do no fill in `authors` for non-packaged applications unless explicitly requested.
let author_from = author_from.unwrap_or_else(|| {
if package {
Expand Down Expand Up @@ -828,9 +832,6 @@ impl InitProjectKind {
}
fs_err::write(path.join("pyproject.toml"), pyproject)?;

// Initialize the version control system.
init_vcs(path, vcs)?;

Ok(())
}

Expand All @@ -855,6 +856,10 @@ impl InitProjectKind {

fs_err::create_dir_all(path)?;

// Initialize the version control system first so that Git configuration can properly
// read conditional includes that depend on the repository path.
init_vcs(path, vcs)?;

let author = get_author_info(path, author_from.unwrap_or_default());

// Create the `pyproject.toml`
Expand All @@ -880,9 +885,6 @@ impl InitProjectKind {
generate_package_scripts(name, path, build_backend, true)?;
}

// Initialize the version control system.
init_vcs(path, vcs)?;

Ok(())
}
}
Expand Down
Loading