@matheusbsbs / matheus-bagliano / commits / 7da3bf372c
Fork 0

Rename static variable write_index to update_index in builtin-apply.c

This is an internal variable used to tell if we need to write out the resulting index. I'll be introducing write_index() function which would collide with it. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Apr 1, 2007 at 22:46 UTC 7da3bf372cfcd25ea44164afb90c306836b62e23
1 file changed +6 -6
builtin-apply.c
+6 -6
@@ -30,7 +30,7 @@ static int unidiff_zero;
30 static int p_value = 1;
31 static int p_value_known;
32 static int check_index;
33 -static int write_index;
33 +static int update_index;
34 static int cached;
35 static int diffstat;
36 static int numstat;
@@ -2308,7 +2308,7 @@ static void patch_stats(struct patch *patch)
2308
2309 static void remove_file(struct patch *patch, int rmdir_empty)
2310 {
2311 - if (write_index) {
2311 + if (update_index) {
2312 if (remove_file_from_cache(patch->old_name) < 0)
2313 die("unable to remove %s from index", patch->old_name);
2314 cache_tree_invalidate_path(active_cache_tree, patch->old_name);
@@ -2335,7 +2335,7 @@ static void add_index_file(const char *path, unsigned mode, void *buf, unsigned
2335 int namelen = strlen(path);
2336 unsigned ce_size = cache_entry_size(namelen);
2337
2338 - if (!write_index)
2338 + if (!update_index)
2339 return;
2340
2341 ce = xcalloc(1, ce_size);
@@ -2662,8 +2662,8 @@ static int apply_patch(int fd, const char *filename, int inaccurate_eof)
2662 if (whitespace_error && (new_whitespace == error_on_whitespace))
2663 apply = 0;
2664
2665 - write_index = check_index && apply;
2666 - if (write_index && newfd < 0)
2665 + update_index = check_index && apply;
2666 + if (update_index && newfd < 0)
2667 newfd = hold_lock_file_for_update(&lock_file,
2668 get_index_file(), 1);
2669 if (check_index) {
@@ -2870,7 +2870,7 @@ int cmd_apply(int argc, const char **argv, const char *unused_prefix)
2870 whitespace_error == 1 ? "s" : "");
2871 }
2872
2873 - if (write_index) {
2873 + if (update_index) {
2874 if (write_cache(newfd, active_cache, active_nr) ||
2875 close(newfd) || commit_lock_file(&lock_file))
2876 die("Unable to write new index file");