From 7b6efdf9254d430f08c207de6dec21013f3cfb84 Mon Sep 17 00:00:00 2001 From: Sebastian Kuzminsky Date: Fri, 11 Jul 2025 10:01:05 -0600 Subject: [PATCH] rename git::add_file() to just add(), it can add directories too --- src/comment.rs | 2 +- src/git.rs | 2 +- src/issue.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/comment.rs b/src/comment.rs index e6c95fd..c7afe44 100644 --- a/src/comment.rs +++ b/src/comment.rs @@ -95,7 +95,7 @@ impl Comment { return Err(CommentError::EditorError); } if description_filename.exists() && description_filename.metadata()?.len() > 0 { - crate::git::add_file(&description_filename)?; + crate::git::add(&description_filename)?; } else { // User saved an empty file, which means they changed their // mind and no longer want to edit the description. diff --git a/src/git.rs b/src/git.rs index 9765996..0ea0ee6 100644 --- a/src/git.rs +++ b/src/git.rs @@ -136,7 +136,7 @@ pub fn worktree_is_dirty(dir: &str) -> Result { return Ok(result.stdout.len() > 0); } -pub fn add_file(file: &std::path::Path) -> Result<(), GitError> { +pub fn add(file: &std::path::Path) -> Result<(), GitError> { let result = std::process::Command::new("git") .args(["add", &file.to_string_lossy()]) .current_dir(file.parent().unwrap()) diff --git a/src/issue.rs b/src/issue.rs index 7201871..3ea6afe 100644 --- a/src/issue.rs +++ b/src/issue.rs @@ -230,7 +230,7 @@ impl Issue { return Err(IssueError::EditorError); } if description_filename.exists() && description_filename.metadata()?.len() > 0 { - crate::git::add_file(&description_filename)?; + crate::git::add(&description_filename)?; } else { // User saved an empty file, which means they changed their // mind and no longer want to edit the description.