summaryrefslogtreecommitdiffstats
path: root/src/git.rs
diff options
context:
space:
mode:
authorqkzk <qu3nt1n@gmail.com>2022-12-16 00:02:04 +0100
committerqkzk <qu3nt1n@gmail.com>2022-12-16 00:02:04 +0100
commitb43cbc1ba788674fadc3e3b8244aa25e2626675b (patch)
tree8e57235fe6f527a5be051c4f1558a8f5399b32d5 /src/git.rs
parent8f59ffdc608b913cedf870e8b5c9418707303020 (diff)
massive documentaion and some refactoring.
Diffstat (limited to 'src/git.rs')
-rw-r--r--src/git.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/git.rs b/src/git.rs
index ab6cf1f..af63936 100644
--- a/src/git.rs
+++ b/src/git.rs
@@ -75,6 +75,8 @@ fn parse_porcelain2(data: String) -> Option<GitStatus> {
Some(status)
}
+/// Returns a string representation of the git status of this path.
+/// Will return an empty string if we're not in a git repository.
pub fn git(path: &Path) -> Result<String, Box<dyn Error>> {
if std::env::set_current_dir(path).is_err() {
// The path may not exist. It should never happen.