Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-01-16 09:17:47 +0300
committerShawn O. Pearce <spearce@spearce.org>2007-01-16 09:17:47 +0300
commit1280158738333109cf0ada2fb378db2cdf7296ad (patch)
tree26411c6349fb1397635b1a717af4d50d4f402259 /fast-import.c
parent8455e48476634eeff6fd2cd4f245cadfef14bbc8 (diff)
Ensure we close the packfile after creating it in fast-import.
Because we are renaming the packfile into its file destination we need to be sure its not open when the rename is called, otherwise some operating systems (e.g. Windows) may prevent the rename from occurring. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'fast-import.c')
-rw-r--r--fast-import.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fast-import.c b/fast-import.c
index 393020504a..a9cf22dfe2 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -645,6 +645,7 @@ static void fixup_header_footer()
SHA1_Final(pack_data->sha1, &c);
write_or_die(pack_fd, pack_data->sha1, sizeof(pack_data->sha1));
+ close(pack_fd);
}
static int oecmp (const void *a_, const void *b_)
@@ -768,14 +769,11 @@ static void end_packfile()
if (!new_p)
die("core git rejected index %s", idx_name);
new_p->windows = old_p->windows;
- new_p->pack_fd = old_p->pack_fd;
all_packs[pack_id++] = new_p;
install_packed_git(new_p);
}
- else {
- close(pack_fd);
+ else
unlink(old_p->pack_name);
- }
free(old_p);
/* We can't carry a delta across packfiles. */