                         else
                             c()
                     async.map(files, f, cb)
+        (cb) ->
+            winston.debug("removing refs/heads/master.lock if present")
+            lock = "#{info.bup_dir}/refs/heads/master.lock"
+            fs.exists lock, (exists) ->
+                if exists
+                    fs.unlink(lock, cb)
+                else
+                    cb()
+
     ], opts.cb)
 
 


    async.series([
        (cb) ->
            if info.master?
                fs.writeFile("#{info.bup_dir}/refs/heads/master", info.master, cb)
            else
                cb()
        (cb) ->
            fs.readdir "#{info.bup_dir}/objects/pack", (err, files) ->
                if err
                    cb(err)

                    winston.debug("monitor_snapshot_queue: no rollback file")
                    cb()

        (cb) ->
            # In some very, very rare cases this file could get left around (probably impossible, but just in case...)
            winston.debug("monitor_snapshot_queue: checking for refs/heads/master.lock")
            lock = bup_active + 'refs/heads/master.lock'
            fs.exists lock, (exists) ->
                if exists
                    fs.unlink(lock, cb)
                else
                    cb()
        (cb) ->
            winston.debug("monitor_snapshot_queue: getting info in case we end up having to rollback this attempt")
            get_rollback_info
