summaryrefslogtreecommitdiff
path: root/diffcore.h
diff options
context:
space:
mode:
authorBo Yang <struggleyb.nku@gmail.com>2010-05-06 21:52:27 -0700
committerJunio C Hamano <gitster@pobox.com>2010-05-07 09:34:27 -0700
commit9ca5df90615aa3c6b60e1bc8f03db6cae98e816c (patch)
tree807f76999f2c9a7aca03d7b308ae8e36bdfd5658 /diffcore.h
parent3bf7886705b4ea7189f046fa5258fdf6edcdbe23 (diff)
downloadgit-9ca5df90615aa3c6b60e1bc8f03db6cae98e816c.tar.gz
Add a macro DIFF_QUEUE_CLEAR.
Refactor the diff_queue_struct code, this macro help to reset the structure. Signed-off-by: Bo Yang <struggleyb.nku@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diffcore.h')
-rw-r--r--diffcore.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/diffcore.h b/diffcore.h
index fcd00bf27a..5d05deaf68 100644
--- a/diffcore.h
+++ b/diffcore.h
@@ -92,6 +92,11 @@ struct diff_queue_struct {
int alloc;
int nr;
};
+#define DIFF_QUEUE_CLEAR(q) \
+ do { \
+ (q)->queue = NULL; \
+ (q)->nr = (q)->alloc = 0; \
+ } while(0);
extern struct diff_queue_struct diff_queued_diff;
extern struct diff_filepair *diff_queue(struct diff_queue_struct *,