Skip to main content

resolve_commit_message_path

Function resolve_commit_message_path 

Source
pub fn resolve_commit_message_path(
    provided: Option<PathBuf>,
    current_dir: &Path,
) -> Result<PathBuf>
Expand description

Resolve the path to the file containing the commit log message.

If provided is Some it is returned unchanged — this is the normal path when git invokes the hook directly.

If provided is None the git repository is discovered starting from current_dir and the path to COMMIT_EDITMSG inside the git directory is returned instead.

§Errors

If no path was provided and no git repository can be discovered from current_dir.