summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4c81b03)
raw | patch | inline | side by side (parent: 4c81b03)
author | Linus Torvalds <torvalds@linux-foundation.org> | |
Fri, 30 May 2008 15:54:46 +0000 (08:54 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 31 May 2008 21:49:29 +0000 (14:49 -0700) |
Since the pack-files are now always created stably on disk, there is no
need to sync() before pruning lose objects or old stale pack-files.
[jc: with Nico's clean-up]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
need to sync() before pruning lose objects or old stale pack-files.
[jc: with Nico's clean-up]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-pack-objects.c | patch | blob | history | |
builtin-prune-packed.c | patch | blob | history | |
builtin-prune.c | patch | blob | history | |
git-repack.sh | patch | blob | history |
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 4c2e0cd27cd6fb963adb2b5e572312869eae3f5d..447d492dbbfb578b8903293fa1d2a988eecfefac 100644 (file)
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
* Did we write the wrong # entries in the header?
* If so, rewrite it like in fast-import
*/
- if (pack_to_stdout || nr_written == nr_remaining) {
- unsigned flags = pack_to_stdout ? CSUM_CLOSE : CSUM_FSYNC;
- sha1close(f, sha1, flags);
+ if (pack_to_stdout) {
+ sha1close(f, sha1, CSUM_CLOSE);
+ } else if (nr_written == nr_remaining) {
+ sha1close(f, sha1, CSUM_FSYNC);
} else {
int fd = sha1close(f, NULL, 0);
fixup_pack_header_footer(fd, sha1, pack_tmp_name, nr_written);
diff --git a/builtin-prune-packed.c b/builtin-prune-packed.c
index 23faf3129fb65ec5592c5021d661498143d4f608..241afbbab54cef58361b0a8284fe1cefcd5dc2a8 100644 (file)
--- a/builtin-prune-packed.c
+++ b/builtin-prune-packed.c
/* Handle arguments here .. */
usage(prune_packed_usage);
}
- sync();
prune_packed_objects(opts);
return 0;
}
diff --git a/builtin-prune.c b/builtin-prune.c
index 25f9304b829c9074e8a034eba5e34c38794058a4..bd3d2f67f3eb54cedb1a6c18582c7e10aa3f7bc6 100644 (file)
--- a/builtin-prune.c
+++ b/builtin-prune.c
mark_reachable_objects(&revs, 1);
prune_object_dir(get_object_directory());
- sync();
prune_packed_objects(show_only);
remove_temporary_files();
return 0;
diff --git a/git-repack.sh b/git-repack.sh
index 10f735cff561c6606f5c2bd3f9feec1d6f6ae52e..072d1b40f7d71aa731c90e9af158a0fe5cf89fde 100755 (executable)
--- a/git-repack.sh
+++ b/git-repack.sh
# We know $existing are all redundant.
if [ -n "$existing" ]
then
- sync
( cd "$PACKDIR" &&
for e in $existing
do