From 704694bd1daf6d58ddf831f0c1a895a84fd95c1e Mon Sep 17 00:00:00 2001 From: Timo Teräs Date: Mon, 27 Feb 2017 10:54:28 +0200 Subject: commit: fix to work if commit_hook.d directory does not exist --- src/commit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commit.c b/src/commit.c index ae9e2c9..80b2c13 100644 --- a/src/commit.c +++ b/src/commit.c @@ -238,7 +238,7 @@ static int run_commit_hook(void *ctx, int dirfd, const char *file) if (apk_verbosity >= 2) apk_message("Executing: %s %s", fn, commit_hook_str[hook->type]); if (apk_db_run_script(db, fn, argv) < 0 && hook->type == PRE_COMMIT_HOOK) - return -1; + return -2; return 0; } @@ -312,7 +312,7 @@ int apk_solver_commit_changeset(struct apk_database *db, } } - if (run_commit_hooks(db, PRE_COMMIT_HOOK) < 0) + if (run_commit_hooks(db, PRE_COMMIT_HOOK) == -2) return -1; /* Go through changes */ -- cgit v1.2.3-70-g09d2