]> git.alsa-project.org Git - alsa.git/commitdiff
optimization for !master branch
authorJaroslav Kysela <perex@perex.cz>
Fri, 13 Jun 2008 08:25:08 +0000 (10:25 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 13 Jun 2008 08:25:08 +0000 (10:25 +0200)
hooks/alsa-kernel.git/pre-receive

index c3194a4260f9a73801891778dada0b8c514c8813..7073be621b5737a6ff5e92b32beabc9dfed8e0c2 100755 (executable)
@@ -396,7 +396,6 @@ def compare_trees(lastref):
 if DO_NOT_CHECK:
     exit(0)
 lines = stdin.readlines()
-read_upstream_commits(lines[0][:-1].split(' ')[0])
 lastref = ''
 for line in lines:
     sha1old, sha1new, refname = line[:-1].split(' ')
@@ -409,12 +408,14 @@ for line in lines:
     elif refname != 'refs/heads/master':
         stderr.write('PRE-RECEIVE: invalid branch "%s"\n' % refname)
         fail()
+    if not lastref:
+       read_upstream_commits(lines[0][:-1].split(' ')[0])
     do_check(sha1old, sha1new, refname)
     lastref = sha1new
 if lastref:
     compare_trees(lastref)
     stderr.write('PRE-RECEIVE: Trees match...\n')
-stderr.write('PRE-RECEIVE: All done\n')
+    stderr.write('PRE-RECEIVE: All done\n')
 if 0:
     stderr.write('PRE-RECEIVE: Test mode active (try later)...\n')
     fail()