summaryrefslogtreecommitdiffstats
path: root/libimagstorestdhook
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2016-10-07 14:07:17 +0200
committerMatthias Beyer <mail@beyermatthias.de>2016-10-07 14:07:17 +0200
commite92fe89270154742bd130ba1b46d61603a083805 (patch)
tree2d8ba688e52f4b867cfaf2271e27e332a5c1a16c /libimagstorestdhook
parentfb475784beadbd7fbef09201b98f4167b6393d2d (diff)
Add more detailed errors
Diffstat (limited to 'libimagstorestdhook')
-rw-r--r--libimagstorestdhook/src/vcs/git/error.rs1
-rw-r--r--libimagstorestdhook/src/vcs/git/store_unload.rs2
2 files changed, 3 insertions, 0 deletions
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 {