From 23f291eaafba99297e6b6284361c63ce0ca2ef67 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Thu, 5 Mar 2009 10:32:03 +0100 Subject: [PATCH] pre-receive: do not fail when patch cannot be applied, just skip it --- hooks/alsa-kernel.git/pre-receive | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hooks/alsa-kernel.git/pre-receive b/hooks/alsa-kernel.git/pre-receive index 6b4a52e..e3dcee4 100755 --- a/hooks/alsa-kernel.git/pre-receive +++ b/hooks/alsa-kernel.git/pre-receive @@ -261,7 +261,10 @@ def try_to_merge(commit): error([], "Please, check if patch was merged to alsa-kmirror.git at first!\n") error([], 'Line: "%s" "%s" "%s" "%s"\n' % (commit['Author'], commit['AuthorDate'], commit['Commit'], commit['CommitDate'])) error([], 'Patch: %s %s' % (commit['commit'][:7], commit['comment'][0])) - fail() + chdir(curdir) + rmtree(worktree, ignore_errors=True) + stderr.write('PRE-RECEIVE: Merge skipped %s %s' % (ref[:7], commit['comment'][0])) + return if system("git --work-tree=%s --git-dir=%s apply -v %s" % (worktree, KMIRROR_REPO, patchfile)): chdir(curdir) raise ValueError, 'git apply' -- 2.47.1