In lockfile.c:commit_locked_index() You didn't include the portion of your patch that assigned NULL to alternate_index_output before attempting to close and rename. Should that be included? -brandon Junio C Hamano wrote: @@ -185,9 +198,15 @@ void set_alternate_index_output(const char *name) int commit_locked_index(struct lock_file *lk) { if (alternate_index_output) { - int result = rename(lk->filename, alternate_index_output); - lk->filename[0] = 0; - return result; + const char *newname = alternate_index_output; + alternate_index_output = NULL; - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html