]> git.alsa-project.org Git - alsa.git/commitdiff
pre-receive: do not fail when patch cannot be applied, just skip it
authorJaroslav Kysela <perex@perex.cz>
Thu, 5 Mar 2009 09:32:03 +0000 (10:32 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 5 Mar 2009 09:32:03 +0000 (10:32 +0100)
hooks/alsa-kernel.git/pre-receive

index 6b4a52e936394d7f431395da25ee98c9bb0961c6..e3dcee439663e5595526e29192945c569fb75eea 100755 (executable)
@@ -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'