summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 12d2a18)
raw | patch | inline | side by side (parent: 12d2a18)
author | Linus Torvalds <torvalds@g5.osdl.org> | |
Sun, 3 Jul 2005 20:36:58 +0000 (13:36 -0700) | ||
committer | Linus Torvalds <torvalds@g5.osdl.org> | |
Sun, 3 Jul 2005 20:36:58 +0000 (13:36 -0700) |
It skips writing the pack-file if it ends up being empty.
pack-objects.c | patch | blob | history |
diff --git a/pack-objects.c b/pack-objects.c
index 780418dcec524fa294064e26a8403d4411cced62..9e9c5788fd2770a67af230c3313b6980cb3fa2bd 100644 (file)
--- a/pack-objects.c
+++ b/pack-objects.c
struct object_entry *delta;
};
+static int non_empty = 0;
static int incremental = 0;
static struct object_entry **sorted_by_sha, **sorted_by_type;
static struct object_entry *objects = NULL;
const char *arg = argv[i];
if (*arg == '-') {
+ if (!strcmp("--non-empty", arg)) {
+ non_empty = 1;
+ continue;
+ }
if (!strcmp("--incremental", arg)) {
incremental = 1;
continue;
}
add_object_entry(sha1, hash);
}
+ if (non_empty && !nr_objects)
+ return 0;
get_object_details();
fprintf(stderr, "Packing %d objects\n", nr_objects);