rename git::add_file() to just add(), it can add directories too
This commit is contained in:
parent
0d6c43d266
commit
7b6efdf925
3 changed files with 3 additions and 3 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ pub fn worktree_is_dirty(dir: &str) -> Result<bool, GitError> {
|
|||
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())
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue