#include "cache.h"
static struct lock_file *lock_file_list;
+static const char *alternate_index_output;
static void remove_lock_file(void)
{
return hold_lock_file_for_update(lk, get_index_file(), die_on_error);
}
+void set_alternate_index_output(const char *name)
+{
+ alternate_index_output = name;
+}
+
int commit_locked_index(struct lock_file *lk)
{
- char *output = getenv(INDEX_OUTPUT_ENVIRONMENT);
- if (output && *output) {
- int result = rename(lk->filename, output);
+ if (alternate_index_output) {
+ int result = rename(lk->filename, alternate_index_output);
lk->filename[0] = 0;
return result;
}