aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtin-pack-objects.c7
-rw-r--r--builtin-prune-packed.c1
-rw-r--r--builtin-prune.c1
-rwxr-xr-xgit-repack.sh1
4 files changed, 4 insertions, 6 deletions
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 4c2e0cd27..447d492db 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -514,9 +514,10 @@ static void write_pack_file(void)
* 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 23faf3129..241afbbab 100644
--- a/builtin-prune-packed.c
+++ b/builtin-prune-packed.c
@@ -85,7 +85,6 @@ int cmd_prune_packed(int argc, const char **argv, const char *prefix)
/* 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 25f9304b8..bd3d2f67f 100644
--- a/builtin-prune.c
+++ b/builtin-prune.c
@@ -156,7 +156,6 @@ int cmd_prune(int argc, const char **argv, const char *prefix)
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 10f735cff..072d1b40f 100755
--- a/git-repack.sh
+++ b/git-repack.sh
@@ -125,7 +125,6 @@ then
# We know $existing are all redundant.
if [ -n "$existing" ]
then
- sync
( cd "$PACKDIR" &&
for e in $existing
do