Skip to content

Commit 7da3bf3

Browse files
author
Junio C Hamano
committed
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 <[email protected]>
1 parent 81e1bc4 commit 7da3bf3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

builtin-apply.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ static int unidiff_zero;
3030
static int p_value = 1;
3131
static int p_value_known;
3232
static int check_index;
33-
static int write_index;
33+
static int update_index;
3434
static int cached;
3535
static int diffstat;
3636
static int numstat;
@@ -2308,7 +2308,7 @@ static void patch_stats(struct patch *patch)
23082308

23092309
static void remove_file(struct patch *patch, int rmdir_empty)
23102310
{
2311-
if (write_index) {
2311+
if (update_index) {
23122312
if (remove_file_from_cache(patch->old_name) < 0)
23132313
die("unable to remove %s from index", patch->old_name);
23142314
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
23352335
int namelen = strlen(path);
23362336
unsigned ce_size = cache_entry_size(namelen);
23372337

2338-
if (!write_index)
2338+
if (!update_index)
23392339
return;
23402340

23412341
ce = xcalloc(1, ce_size);
@@ -2662,8 +2662,8 @@ static int apply_patch(int fd, const char *filename, int inaccurate_eof)
26622662
if (whitespace_error && (new_whitespace == error_on_whitespace))
26632663
apply = 0;
26642664

2665-
write_index = check_index && apply;
2666-
if (write_index && newfd < 0)
2665+
update_index = check_index && apply;
2666+
if (update_index && newfd < 0)
26672667
newfd = hold_lock_file_for_update(&lock_file,
26682668
get_index_file(), 1);
26692669
if (check_index) {
@@ -2870,7 +2870,7 @@ int cmd_apply(int argc, const char **argv, const char *unused_prefix)
28702870
whitespace_error == 1 ? "s" : "");
28712871
}
28722872

2873-
if (write_index) {
2873+
if (update_index) {
28742874
if (write_cache(newfd, active_cache, active_nr) ||
28752875
close(newfd) || commit_lock_file(&lock_file))
28762876
die("Unable to write new index file");

0 commit comments

Comments
 (0)