[projects/git-slug: 59/170] Fix removing of branches

glen glen at pld-linux.org
Mon Sep 21 21:43:46 CEST 2015


commit 13dbcf40f60b0ad1bcdc3a8029ff13de612a19f7
Author: Kacper Kornet <draenog at pld-linux.org>
Date:   Wed Oct 12 16:58:12 2011 +0100

    Fix removing of branches
    
    The removed branches can be identified by SHA1='000..'. They should be
    removed from heads file

 watch.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/watch.py b/watch.py
index 7ee9625..d4f402e 100755
--- a/watch.py
+++ b/watch.py
@@ -5,7 +5,7 @@ import os
 import pyinotify
 import shutil
 
-from git_slug.gitconst import REFREPO, REFFILE
+from git_slug.gitconst import EMPTYSHA1, REFREPO, REFFILE
 from git_slug.serverconst import WATCHDIR
 from git_slug.refsdata import RemoteRefsData
 from git_slug.gitrepo import GitRepo
@@ -45,7 +45,8 @@ def process_file(pathname):
             if (repo, ref) == oldtuple:
                 continue
             oldtuple = (repo, ref)
-            print(sha1, ref, repo, file=headfile_new)
+            if sha1 != EMPTYSHA1:
+                print(sha1, ref, repo, file=headfile_new)
     shutil.copyfile(os.path.join(REFREPO_WDIR, REFFILE_NEW), os.path.join(REFREPO_WDIR, REFFILE))
 
     headrepo = GitRepo(REFREPO_WDIR, REFREPO_GDIR)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/git-slug.git/commitdiff/4ed64f73960519a2f4fd04c42950b2c96ae795c5



More information about the pld-cvs-commit mailing list