From e92fe89270154742bd130ba1b46d61603a083805 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Fri, 7 Oct 2016 14:07:17 +0200 Subject: [PATCH] Add more detailed errors --- libimagstorestdhook/src/vcs/git/error.rs | 1 + libimagstorestdhook/src/vcs/git/store_unload.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/libimagstorestdhook/src/vcs/git/error.rs b/libimagstorestdhook/src/vcs/git/error.rs index 0481ebef..34ae0439 100644 --- a/libimagstorestdhook/src/vcs/git/error.rs +++ b/libimagstorestdhook/src/vcs/git/error.rs @@ -40,6 +40,7 @@ generate_error_module!( RepositoryPathAddingError => "Error while adding Path to Index", RepositoryCommittingError => "Error while committing", RepositoryParentFetchingError => "Error while fetching parent of commit", + RepositoryStatusFetchError => "Error while fetching repository status", HeadFetchError => "Error while getting HEAD", NotOnBranch => "No Branch is checked out", diff --git a/libimagstorestdhook/src/vcs/git/store_unload.rs b/libimagstorestdhook/src/vcs/git/store_unload.rs index 06bbefe6..52d8860f 100644 --- a/libimagstorestdhook/src/vcs/git/store_unload.rs +++ b/libimagstorestdhook/src/vcs/git/store_unload.rs @@ -160,6 +160,7 @@ impl StoreIdAccessor for StoreUnloadHook { }) .any(|s| s == new || s == modif || s == del || s == ren) }) + .map_err_into(GHEK::RepositoryStatusFetchError) .map_err_into(GHEK::RepositoryError) .map_into_hook_error() }; @@ -168,6 +169,7 @@ impl StoreIdAccessor for StoreUnloadHook { if add_wt_changes_before_committing(cfg) { debug!("Adding WT changes before committing."); try!(index.add_all(&["*"], ADD_DEFAULT, None) + .map_err_into(GHEK::RepositoryPathAddingError) .map_err_into(GHEK::RepositoryError) .map_into_hook_error()); } else {