Thread (133 messages) 133 messages, 6 authors, 2016-06-16
STALE3643d
Revisions (2)
  1. v1 current
  2. v2 [diff vs current]

[PATCH 50/83] builtin/apply: get rid of the 'newfd' global

From: Christian Couder <hidden>
Date: 2016-06-16 02:18:56
Subsystem: the rest · Maintainer: Linus Torvalds

The 'newfd' global is useless now as we can just test
for "lock_file == NULL" instead of "newfd < 0".

Signed-off-by: Christian Couder <redacted>
---
 builtin/apply.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/builtin/apply.c b/builtin/apply.c
index d26419a..84ff2da 100644
--- a/builtin/apply.c
+++ b/builtin/apply.c
@@ -141,8 +141,6 @@ struct apply_state {
 	enum ws_ignore ws_ignore_action;
 };
 
-static int newfd = -1;
-
 static const char * const apply_usage[] = {
 	N_("git apply [<options>] [<patch>...]"),
 	NULL
@@ -4572,9 +4570,9 @@ static int apply_patch(struct apply_state *state,
 		state->apply = 0;
 
 	state->update_index = state->check_index && state->apply;
-	if (state->update_index && newfd < 0) {
+	if (state->update_index && state->lock_file == NULL) {
 		state->lock_file = xcalloc(1, sizeof(struct lock_file));
-		newfd = hold_locked_index(state->lock_file, 1);
+		hold_locked_index(state->lock_file, 1);
 	}
 
 	if (state->check_index) {
-- 
2.8.1.300.g5fed0c0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help