]> source.dussan.org Git - gitea.git/commitdiff
resolved #155
authorLunny Xiao <xiaolunwen@gmail.com>
Sat, 3 May 2014 03:12:15 +0000 (11:12 +0800)
committerLunny Xiao <xiaolunwen@gmail.com>
Sat, 3 May 2014 03:12:15 +0000 (11:12 +0800)
models/update.go

index 648c45f160d25b75685bc52b628fc6cc5fb51b2c..75bcc1d487e0c1a681d322114c06df1d892aef38 100644 (file)
@@ -29,6 +29,12 @@ func Update(refName, oldCommitId, newCommitId, userName, repoName string, userId
        gitUpdate.Dir = f
        gitUpdate.Run()
 
+       isDel := strings.HasPrefix(newCommitId, "0000000")
+       if isDel {
+               qlog.Info("del rev", refName, "from", userName+"/"+repoName+".git", "by", userId)
+               return
+       }
+
        repo, err := git.OpenRepository(f)
        if err != nil {
                qlog.Fatalf("runUpdate.Open repoId: %v", err)