t / helper / test-scrap-cache-tree.con commit t4030: abstract away SHA-1-specific constants (a6c5799)
   1#include "test-tool.h"
   2#include "cache.h"
   3#include "lockfile.h"
   4#include "tree.h"
   5#include "cache-tree.h"
   6
   7static struct lock_file index_lock;
   8
   9int cmd__scrap_cache_tree(int ac, const char **av)
  10{
  11        setup_git_directory();
  12        hold_locked_index(&index_lock, LOCK_DIE_ON_ERROR);
  13        if (read_cache() < 0)
  14                die("unable to read index file");
  15        active_cache_tree = NULL;
  16        if (write_locked_index(&the_index, &index_lock, COMMIT_LOCK))
  17                die("unable to write index file");
  18        return 0;
  19}