Skip to content

Commit ecce271

Browse files
committed
docs: add missing documentation for pull, clone, and hash functions
1 parent 38ddf56 commit ecce271

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/src/gitbridge/systemgit.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::{path::Path, process::Command};
77
use crate::repos::Boilerplate;
88
use crate::Result;
99

10-
///
10+
/// Run `git pull {remote} {branch}` on the repository at the given path.
1111
pub fn pull(repo_path: &Path, remote: &str, branch: &str) -> Result<()> {
1212
let args = ["pull", remote, branch];
1313
log::info!("Executing: git {:?} on {repo_path:?}", args.join(" "));
@@ -28,6 +28,7 @@ pub fn pull(repo_path: &Path, remote: &str, branch: &str) -> Result<()> {
2828
}
2929
}
3030

31+
/// Run `git clone {url} {dest_path}` to clone the repository.
3132
pub fn clone<S: AsRef<str>, P: AsRef<Path>>(url: S, dest_path: P) -> crate::Result<()> {
3233
let dest_path = dest_path.as_ref().to_string_lossy().to_string();
3334
let args = ["clone", url.as_ref(), dest_path.as_ref()];
@@ -47,6 +48,7 @@ pub fn clone<S: AsRef<str>, P: AsRef<Path>>(url: S, dest_path: P) -> crate::Resu
4748
}
4849

4950
/// Returns the latest commit hash (as bytes) of the given boilerplate in the repository located at base_path.
51+
/// For this, run `git log --format=%H -n 1 {boilerplate.path()}` on the `{base_path}/{boilerplate.repo_path()}` directory.
5052
pub fn hash<P: AsRef<Path>>(boilerplate: &Boilerplate, base_path: P) -> Result<Vec<u8>> {
5153
let base_path = base_path.as_ref();
5254
log::info!(

0 commit comments

Comments
 (0)