From: Junio C Hamano <junkio@cox.net>
Date: Sat, 7 Apr 2007 09:26:24 +0000 (-0700)
Subject: Merge branch 'jc/index-output'
X-Git-Tag: v1.5.2-rc0~75
X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/ee9693e246669f48f6b058a1044cefa973a44c22

Merge branch 'jc/index-output'

* jc/index-output:
git-read-tree --index-output=<file>
_GIT_INDEX_OUTPUT: allow plumbing to output to an alternative index file.

Conflicts:

builtin-apply.c
---

ee9693e246669f48f6b058a1044cefa973a44c22
diff --cc builtin-apply.c
index 4b8311b4de,12011c1c9e..fd92ef7174
--- a/builtin-apply.c
+++ b/builtin-apply.c
@@@ -2662,10 -2662,10 +2662,10 @@@ static int apply_patch(int fd, const ch
  	if (whitespace_error && (new_whitespace == error_on_whitespace))
  		apply = 0;
  
 -	write_index = check_index && apply;
 -	if (write_index && newfd < 0)
 +	update_index = check_index && apply;
 +	if (update_index && newfd < 0)
- 		newfd = hold_lock_file_for_update(&lock_file,
- 						  get_index_file(), 1);
+ 		newfd = hold_locked_index(&lock_file, 1);
+ 
  	if (check_index) {
  		if (read_cache() < 0)
  			die("unable to read index file");
@@@ -2870,9 -2870,9 +2870,9 @@@ int cmd_apply(int argc, const char **ar
  				whitespace_error == 1 ? "s" : "");
  	}
  
 -	if (write_index) {
 +	if (update_index) {
  		if (write_cache(newfd, active_cache, active_nr) ||
- 		    close(newfd) || commit_lock_file(&lock_file))
+ 		    close(newfd) || commit_locked_index(&lock_file))
  			die("Unable to write new index file");
  	}