           filename: "#{argv.name}#{obj}"
           content_type: 'application/octet-stream'
           alias: []
-          metadata: {}
+          metadata:
+            _Git: {}
           chunkSize: argv.chunksize
           mode: 'w'
         ,

              ws.lockReleased (err, ld) ->
                cb null, file

  async.series [
    (cb) ->
      async.eachLimit objList, 1, doIt, cb
  ] , (err) ->
    throw err if err
    db.close (err) ->
      console.error "Couldn't close database connection, #{err}" if err
      console.log "Disconnected from mongo!"

  # cleanup
  rm '-rf', tmpdir

console.log "Calculate info-refs"
exec 'git update-server-info'

server = new mongo.Server argv.host, argv.port
db = new mongo.Db argv.db, server, {w:1}
db.open (err) ->
  console.error "Couldn't open database connection, #{err}" if err
  console.log "Connected to mongo!"
  grid = new gfs db, mongo, argv.gridfs

  writeObj = (obj, cb) ->
    console.log "Processing #{argv.name}#{obj}"
    # Check for object in gridfs
    grid.exist { _id: "#{argv.name}#{obj}" }, (err, found) ->
      if err or found
