<commit_before>var helper = require('../../helper');
var ensure = helper.ensure;
var logger = helper.logger;

var getByPath = require('./getByPath');
var set = require('./set');
var catchRename = require('./_catchRename').forDeleted;

module.exports = function drop (blogID, path, callback) {

  ensure(blogID, 'string')
    .and(path, 'string')
    .and(callback, 'function');

  get(blogID, path, function(entry){

    // There's nothing to delete
    if (!existing || !existing.id) return callback();

    catchRename(blogID, existing, function(err, wasRenamed){

      if (err) return callback(err);

      if (wasRenamed) return callback();

      logger(null, 'Blog: ' + blogID + ': Deleted entry', path);
      set(blogID, existing.id, {deleted: true}, callback);
    });
  });
};

<commit_msg>removed catch rename from Entry.drop<commit_after>var helper = require('../../helper');
var ensure = helper.ensure;
var logger = helper.logger;

var getByPath = require('./getByPath');
var set = require('./set');

module.exports = function drop (blogID, path, callback) {

  ensure(blogID, 'string')
    .and(path, 'string')
    .and(callback, 'function');

  get(blogID, path, function(entry){

    if (!entry) {
      logger(null, 'Blog: ' + blogID + ': No entry to delete', path);
      return callback();
    }

    logger(null, 'Blog: ' + blogID + ': Deleting entry', path);
    set(blogID, path, {deleted: true}, callback);
  });
};


{'fraction_non_alphanumeric': 0.17696044413601666, 'fraction_numerical': 0.0, 'mean_word_length': 3.6516129032258067, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '737523', 'n_tokens_mistral': 464, 'n_tokens_neox': 445, 'n_words': 122}