     index = 0
     _async.whilst(
       (-> index < commits.length)
-      ((done)-> self.saveCommit(project_id, commits[index++], done))
+      ((done)->
+        commit = commits[index++]
+        cond = sha: commit.sha
+
+        console.log commit
+        self.find cond, (err, result)->
+          if result.items.length > 0
+            _log "Commit has already exists -> #{commit.sha}"
+            done null
+          else
+            self.saveCommit project_id, commit, done
+      )
       cb
     )
 

    queue.push(
      (done)->
        #必须满足条件
        done null, 0 if not (isCreate and project_id and member_id)
        #如果包含isCreate，则创建一个issue
        #提取标签
        tag =  if message.match /@(.+)\s/ then RegExp.$1 else 'new'
        tag = _common.checkTag tag
        #替换掉message中的标签
        data =
          title: message.replace(/#(new|doing|done|ok)/ig, '').replace(/@(.+)\s/, '')
          status: if isDoing then 'doing' else 'new'
          member_id: member_id
          owner: member_id
          timestamp: new Date()
          tag: tag
          project_id: project_id

        self.save data, (err, id)->
          _log "创建新的issue，id -> #{id}"
          issue_id = id
          done err

    queue.push(
      (done)->
        #没有获得issue id，不处理
        return done null if not (issue_id and isDoing and member_id)
        issue = new _Issue member
        data = id: issue_id, status: 'doing'
        issue.save data, ()-> done null
    )

    #处理done
    queue.push(
      (done)->
        return done null if not (issue_id and isDone and member_id)
        #如果有done标签，则完成这个issue
        issue = new _Issue member
        issue.finishedIssue issue_id, done
    )

    _async.waterfall queue, (err)->
      console.log '新的哈哈哈id', issue_id
      cb err, issue_id


  #根据git用户名查找对应的用户id
