mirror of
https://github.com/dexoron/dcr.git
synced 2026-10-22 11:59:37 +00:00
docs: add and clean up AI-generated rustdoc comments (grok-4.5)
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
use std::path::Path;
|
||||
use std::process::Command;
|
||||
|
||||
/// Checks if the `git` executable is available in the system's PATH.
|
||||
///
|
||||
/// This function executes `git --version` and returns `true` if the command succeeds, `false` otherwise.
|
||||
pub fn is_git_available() -> bool {
|
||||
Command::new("git")
|
||||
.arg("--version")
|
||||
@@ -9,6 +12,7 @@ pub fn is_git_available() -> bool {
|
||||
.unwrap_or(false)
|
||||
}
|
||||
|
||||
/// Initializes a new Git repository at the specified path.
|
||||
pub fn git_init(path: &Path) -> Result<(), String> {
|
||||
if !is_git_available() {
|
||||
return Err("git executable not found in PATH".to_string());
|
||||
|
||||
Reference in New Issue
Block a user