summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-06-23 06:32:19 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-06-23 06:32:19 (GMT)
commit9bee7aabcd74bf112fcdaf255551147feca8f66c (patch)
tree7e880ce1ba6dc9e59a30fdc1cbdc0f3e8b0992e3 /cache.h
parent55f22ff22e5ff6c21b50cf379ee946f9642fc3cb (diff)
parent25fd2f7a310df17dca298a3acf2aba716ceb8ce3 (diff)
downloadgit-9bee7aabcd74bf112fcdaf255551147feca8f66c.zip
git-9bee7aabcd74bf112fcdaf255551147feca8f66c.tar.gz
git-9bee7aabcd74bf112fcdaf255551147feca8f66c.tar.bz2
Merge branch 'ei/oneline+add-empty'
* ei/oneline+add-empty: Fix ALLOC_GROW calls with obsolete semantics Fix ALLOC_GROW off-by-one builtin-add: simplify (and increase accuracy of) exclude handling dir_struct: add collect_ignored option Extend --pretty=oneline to cover the first paragraph, Lift 16kB limit of log message output
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/cache.h b/cache.h
index cec19ba..ed83d92 100644
--- a/cache.h
+++ b/cache.h
@@ -234,8 +234,11 @@ extern void verify_non_filename(const char *prefix, const char *name);
*/
#define ALLOC_GROW(x, nr, alloc) \
do { \
- if ((nr) >= alloc) { \
- alloc = alloc_nr(alloc); \
+ if ((nr) > alloc) { \
+ if (alloc_nr(alloc) < (nr)) \
+ alloc = (nr); \
+ else \
+ alloc = alloc_nr(alloc); \
x = xrealloc((x), alloc * sizeof(*(x))); \
} \
} while(0)