summaryrefslogtreecommitdiff
path: root/git.c
diff options
context:
space:
mode:
authorMartin Ågren <martin.agren@gmail.com>2020-11-29 20:52:21 +0100
committerJunio C Hamano <gitster@pobox.com>2020-11-30 13:55:54 -0800
commit6ba9bb76e0279bce9f614cb7f4ee28d8a601e79e (patch)
treec7c287563a004035efd7ddfa6298a60d2b3cc5ea /git.c
parent96313423a75fa8d88b6ecd5a15c21a7fbaf9e9be (diff)
grep: copy struct in one fell swoop
We have a `struct grep_opt` with our defaults which we then copy into the caller's struct. Rather than zeroing the target struct and copying each element one by one, just copy everything at once. This leaves the code simpler and more maintainable. We don't have any ownership issues with what we're copying now and can just greedily copy the whole thing. If and when we do need to handle such elements (`char *`?), we must and can handle it appropriately. Make sure to leave a comment to our future selves. Signed-off-by: Martin Ågren <martin.agren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git.c')
0 files changed, 0 insertions, 0 deletions