builtin/difftool.c: { 0 }-initialize rather than using memset()
Refactor an initialization of a variable added in
03831ef7b5
(difftool: implement the functionality in the builtin,
2017-01-19). This refactoring makes a subsequent change smaller.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Acked-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
a38d39a4c5
commit
0dda3ac925
@ -361,7 +361,7 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix,
|
|||||||
struct hashmap symlinks2 = HASHMAP_INIT(pair_cmp, NULL);
|
struct hashmap symlinks2 = HASHMAP_INIT(pair_cmp, NULL);
|
||||||
struct hashmap_iter iter;
|
struct hashmap_iter iter;
|
||||||
struct pair_entry *entry;
|
struct pair_entry *entry;
|
||||||
struct index_state wtindex;
|
struct index_state wtindex = { 0 };
|
||||||
struct checkout lstate, rstate;
|
struct checkout lstate, rstate;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
struct child_process cmd = CHILD_PROCESS_INIT;
|
struct child_process cmd = CHILD_PROCESS_INIT;
|
||||||
@ -387,8 +387,6 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix,
|
|||||||
mkdir(ldir.buf, 0700);
|
mkdir(ldir.buf, 0700);
|
||||||
mkdir(rdir.buf, 0700);
|
mkdir(rdir.buf, 0700);
|
||||||
|
|
||||||
memset(&wtindex, 0, sizeof(wtindex));
|
|
||||||
|
|
||||||
memset(&lstate, 0, sizeof(lstate));
|
memset(&lstate, 0, sizeof(lstate));
|
||||||
lstate.base_dir = lbase_dir = xstrdup(ldir.buf);
|
lstate.base_dir = lbase_dir = xstrdup(ldir.buf);
|
||||||
lstate.base_dir_len = ldir.len;
|
lstate.base_dir_len = ldir.len;
|
||||||
|
Reference in New Issue
Block a user