summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1788c39)
raw | patch | inline | side by side (parent: 1788c39)
author | Shawn O. Pearce <spearce@spearce.org> | |
Fri, 14 Sep 2007 07:31:25 +0000 (03:31 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 19 Sep 2007 10:22:31 +0000 (03:22 -0700) |
If we are using a native transport and the transport chose to
save the packfile it may have created a .keep file to protect
the packfile from a concurrently running git-repack process.
In such a case the git-fetch process should make sure it will
unlink the .keep file even if it fails to update any refs as
otherwise the newly downloaded packfile's diskspace will never
be reclaimed if the objects are not actually referenced.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
save the packfile it may have created a .keep file to protect
the packfile from a concurrently running git-repack process.
In such a case the git-fetch process should make sure it will
unlink the .keep file even if it fails to update any refs as
otherwise the newly downloaded packfile's diskspace will never
be reclaimed if the objects are not actually referenced.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-fetch.c | patch | blob | history |
diff --git a/builtin-fetch.c b/builtin-fetch.c
index 8e433d1bf23e7c31aad43c13501c58bcd035cf2e..8b0fdbe90502e16117d0bf4ea2193e830fa7857f 100644 (file)
--- a/builtin-fetch.c
+++ b/builtin-fetch.c
static int append, force, tags, no_tags, update_head_ok, verbose, quiet;
static char *default_rla = NULL;
+static struct transport *transport;
+
+static void unlock_pack(void)
+{
+ if (transport)
+ transport_unlock_pack(transport);
+}
+
+static void unlock_pack_on_signal(int signo)
+{
+ unlock_pack();
+ signal(SIGINT, SIG_DFL);
+ raise(signo);
+}
static void find_merge_config(struct ref *ref_map, struct remote *remote)
{
int cmd_fetch(int argc, const char **argv, const char *prefix)
{
struct remote *remote;
- struct transport *transport;
int i, j, rla_offset;
static const char **refs = NULL;
int ref_nr = 0;
printf("ref: %s\n", refs[j]);
}
+ signal(SIGINT, unlock_pack_on_signal);
+ atexit(unlock_pack);
return do_fetch(transport, parse_ref_spec(ref_nr, refs), ref_nr);
}