diff options
author | Junio C Hamano <junkio@cox.net> | 2007-04-25 23:31:45 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-04-25 23:31:45 -0700 |
commit | 6169a89c4fd29cf9c747bab7bd310877328bc7e2 (patch) | |
tree | 299d1cd315b66e377261901698bc128752466fc8 /sha1_file.c | |
parent | Add --date={local,relative,default} (diff) | |
parent | Start preparing for 1.5.1.3 (diff) | |
download | tgif-6169a89c4fd29cf9c747bab7bd310877328bc7e2.tar.xz |
Merge branch 'maint'
* maint:
Start preparing for 1.5.1.3
Sanitize @to recipients.
git-svn: Ignore usernames in URLs in find_by_url
Document --dry-run and envelope-sender for git-send-email.
Allow users to optionally specify their envelope sender.
Ensure clean addresses are always used with Net::SMTP
Validate @recipients before using it for sendmail and Net::SMTP.
Perform correct quoting of recipient names.
Change the scope of the $cc variable as it is not needed outside of send_message.
Debugging cleanup improvements
Prefix Dry- to the message status to denote dry-runs.
Document --dry-run parameter to send-email.
git-svn: Don't rely on $_ after making a function call
Fix handle leak in write_tree
Actually handle some-low memory conditions
Conflicts:
RelNotes
git-send-email.perl
Diffstat (limited to 'sha1_file.c')
-rw-r--r-- | sha1_file.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sha1_file.c b/sha1_file.c index 06426640ea..32244d704e 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -549,7 +549,7 @@ static void scan_windows(struct packed_git *p, } } -static int unuse_one_window(struct packed_git *current) +static int unuse_one_window(struct packed_git *current, int keep_fd) { struct packed_git *p, *lru_p = NULL; struct pack_window *lru_w = NULL, *lru_l = NULL; @@ -565,7 +565,7 @@ static int unuse_one_window(struct packed_git *current) lru_l->next = lru_w->next; else { lru_p->windows = lru_w->next; - if (!lru_p->windows && lru_p != current) { + if (!lru_p->windows && lru_p->pack_fd != keep_fd) { close(lru_p->pack_fd); lru_p->pack_fd = -1; } @@ -577,10 +577,10 @@ static int unuse_one_window(struct packed_git *current) return 0; } -void release_pack_memory(size_t need) +void release_pack_memory(size_t need, int fd) { size_t cur = pack_mapped; - while (need >= (cur - pack_mapped) && unuse_one_window(NULL)) + while (need >= (cur - pack_mapped) && unuse_one_window(NULL, fd)) ; /* nothing */ } @@ -713,7 +713,7 @@ unsigned char* use_pack(struct packed_git *p, win->len = (size_t)len; pack_mapped += win->len; while (packed_git_limit < pack_mapped - && unuse_one_window(p)) + && unuse_one_window(p, p->pack_fd)) ; /* nothing */ win->base = xmmap(NULL, win->len, PROT_READ, MAP_PRIVATE, |