From: Dmitry Ivankov <divanorama@gmail.com>
To: git@vger.kernel.org
Cc: Jonathan Nieder <jrnieder@gmail.com>,
"Shawn O. Pearce" <spearce@spearce.org>,
David Barr <davidbarr@google.com>,
Dmitry Ivankov <divanorama@gmail.com>
Subject: [PATCH 2/3] fast-import: fix corner case for checkpoint
Date: Mon, 19 Sep 2011 01:01:47 +0600 [thread overview]
Message-ID: <1316372508-7173-3-git-send-email-divanorama@gmail.com> (raw)
In-Reply-To: <1316372508-7173-1-git-send-email-divanorama@gmail.com>
checkpoint command makes fast-import finish current pack and write out
branches/tags and marks. In case no new objects are added in current
pack fast-import falls back to no-op. While it is possible that refs
or marks need to be updated (to point to old objects).
Make fast-import always dump them on checkpoint. But as before do not
cycle_packfile if there are no objects to write.
Signed-off-by: Dmitry Ivankov <divanorama@gmail.com>
---
fast-import.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/fast-import.c b/fast-import.c
index 907cb05..014a807 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -3025,12 +3025,11 @@ static void parse_ls(struct branch *b)
static void checkpoint(void)
{
checkpoint_requested = 0;
- if (object_count) {
+ if (object_count)
cycle_packfile();
- dump_branches();
- dump_tags();
- dump_marks();
- }
+ dump_branches();
+ dump_tags();
+ dump_marks();
}
static void parse_checkpoint(void)
--
1.7.3.4
next prev parent reply other threads:[~2011-09-18 18:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-18 19:01 [PATCH 0/3] fast-import: fix pack_id corner cases Dmitry Ivankov
2011-09-18 19:01 ` [PATCH 1/3] fast-import: die if we produce too many (MAX_PACK_ID) packs Dmitry Ivankov
2011-09-18 19:17 ` Jonathan Nieder
2011-09-18 19:01 ` Dmitry Ivankov [this message]
2011-09-18 19:28 ` [PATCH 2/3] fast-import: fix corner case for checkpoint Jonathan Nieder
2011-09-18 19:01 ` [PATCH 3/3] fast-import: rename object_count to pack_object_count Dmitry Ivankov
2011-09-18 19:32 ` Jonathan Nieder
2011-09-18 19:51 ` Dmitry Ivankov
2011-09-18 21:40 ` Jonathan Nieder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1316372508-7173-3-git-send-email-divanorama@gmail.com \
--to=divanorama@gmail.com \
--cc=davidbarr@google.com \
--cc=git@vger.kernel.org \
--cc=jrnieder@gmail.com \
--cc=spearce@spearce.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).