diff options
Diffstat (limited to 'local/git.gentoo.org')
-rwxr-xr-x | local/git.gentoo.org/pre-receive.gentoo-news | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/local/git.gentoo.org/pre-receive.gentoo-news b/local/git.gentoo.org/pre-receive.gentoo-news index c8cffee..a820507 100755 --- a/local/git.gentoo.org/pre-receive.gentoo-news +++ b/local/git.gentoo.org/pre-receive.gentoo-news @@ -17,6 +17,8 @@ PATH_REGEX = re.compile(r''' . (?P<lang> [a-z]{2}) .txt (?: .asc )? ''', re.VERBOSE) +# special git commit id +ZEROS = '0000000000000000000000000000000000000000' def main(prog, *argv): if 'GIT_DIR' not in os.environ: @@ -35,6 +37,11 @@ def main(prog, *argv): return 1 def validate(oldrev, newrev, refname): + # Deletion of a branch means no work to do anyway. + # And git-diff will fail + if newrev == ZEROS: + return 0 + proc = subprocess.Popen( \ ['git', 'diff', \ '--name-only', '--diff-filter=A', \ |