summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-09-26 23:09:21 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-09-26 23:09:21 (GMT)
commite683f17e6319b461def179b84d20dbcca546018a (patch)
tree83b8f3984ff989409a57073d754f3b42d75507a9 /builtin
parent48b21818ca5069285145b2fdb98f2e355637bb06 (diff)
parent68e3d6292f27f123c072175748183c9cb9bc1c70 (diff)
downloadgit-e683f17e6319b461def179b84d20dbcca546018a.zip
git-e683f17e6319b461def179b84d20dbcca546018a.tar.gz
git-e683f17e6319b461def179b84d20dbcca546018a.tar.bz2
Merge branch 'rs/checkout-init-macro'
Code cleanup. * rs/checkout-init-macro: introduce CHECKOUT_INIT
Diffstat (limited to 'builtin')
-rw-r--r--builtin/checkout-index.c2
-rw-r--r--builtin/checkout.c3
2 files changed, 2 insertions, 3 deletions
diff --git a/builtin/checkout-index.c b/builtin/checkout-index.c
index 92c6967..30a49d9 100644
--- a/builtin/checkout-index.c
+++ b/builtin/checkout-index.c
@@ -16,7 +16,7 @@ static int checkout_stage; /* default to checkout stage0 */
static int to_tempfile;
static char topath[4][TEMPORARY_FILENAME_LENGTH + 1];
-static struct checkout state;
+static struct checkout state = CHECKOUT_INIT;
static void write_tempfile_record(const char *name, const char *prefix)
{
diff --git a/builtin/checkout.c b/builtin/checkout.c
index f4b24a4..9b2a5b3 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -239,7 +239,7 @@ static int checkout_paths(const struct checkout_opts *opts,
const char *revision)
{
int pos;
- struct checkout state;
+ struct checkout state = CHECKOUT_INIT;
static char *ps_matched;
struct object_id rev;
struct commit *head;
@@ -352,7 +352,6 @@ static int checkout_paths(const struct checkout_opts *opts,
return 1;
/* Now we are committed to check them out */
- memset(&state, 0, sizeof(state));
state.force = 1;
state.refresh_cache = 1;
state.istate = &the_index;