diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2007-09-14 03:31:23 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-09-19 03:22:30 -0700 |
commit | 1788c39cd0742439b9bedc28bc10bc4d105b6c0f (patch) | |
tree | 7cb5e53238b90e0c9bdcc1812c9ca266af1a12b9 /builtin-fetch.c | |
parent | 106764e6515dd0fb9fda8bb8cab523932ae903b3 (diff) | |
download | git-1788c39cd0742439b9bedc28bc10bc4d105b6c0f.tar.gz |
Remove pack.keep after ref updates in git-fetch
If we are using a native packfile to perform a git-fetch invocation
and the received packfile contained more than the configured limits
of fetch.unpackLimit/transfer.unpackLimit then index-pack will output
a single line saying "keep\t$sha1\n" to stdout. This line needs to
be captured and retained so we can delete the corresponding .keep
file ("$GIT_DIR/objects/pack/pack-$sha1.keep") once all refs have
been safely updated.
This trick has long been in use with git-fetch.sh and its lower level
helper git-fetch--tool as a way to allow index-pack to save the new
packfile before the refs have been updated and yet avoid a race with
any concurrently running git-repack process. It was unfortunately
lost when git-fetch.sh was converted to pure C and fetch--tool was
no longer being invoked.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-fetch.c')
-rw-r--r-- | builtin-fetch.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin-fetch.c b/builtin-fetch.c index f5a2718acc..8e433d1bf2 100644 --- a/builtin-fetch.c +++ b/builtin-fetch.c @@ -274,6 +274,7 @@ static int fetch_refs(struct transport *transport, struct ref *ref_map) int ret = transport_fetch_refs(transport, ref_map); if (!ret) store_updated_refs(transport->url, ref_map); + transport_unlock_pack(transport); return ret; } |