summaryrefslogtreecommitdiff
path: root/builtin-bundle.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-08-09 00:01:49 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-08-11 05:19:06 (GMT)
commit7fa8254f9476de24661e93b2a90c6ce30dc10006 (patch)
tree65c74238f402ae0c65476804029851e6af5027f6 /builtin-bundle.c
parentd699676dda5fdf0996601006c3bac2a9c077a862 (diff)
downloadgit-7fa8254f9476de24661e93b2a90c6ce30dc10006.zip
git-7fa8254f9476de24661e93b2a90c6ce30dc10006.tar.gz
git-7fa8254f9476de24661e93b2a90c6ce30dc10006.tar.bz2
allow git-bundle to create bottomless bundle
While "git bundle" was a useful way to sneakernet incremental changes, we did not allow: $ git bundle create v2.6.20.bndl v2.6.20 to create a bundle that contains the whole history to a well-known good revision. Such a bundle can be mirrored everywhere, and people can prime their repository with it to reduce the load on the repository that serves near the tip of the development. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-bundle.c')
-rw-r--r--builtin-bundle.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/builtin-bundle.c b/builtin-bundle.c
index 6ae5ab0..cb439ca 100644
--- a/builtin-bundle.c
+++ b/builtin-bundle.c
@@ -208,6 +208,10 @@ static int create_bundle(struct bundle_header *header, const char *path,
struct rev_info revs;
struct child_process rls;
+ /*
+ * NEEDSWORK: this should use something like lock-file
+ * to create temporary that is cleaned up upon error.
+ */
bundle_fd = (!strcmp(path, "-") ? 1 :
open(path, O_CREAT | O_EXCL | O_WRONLY, 0666));
if (bundle_fd < 0)
@@ -267,8 +271,12 @@ static int create_bundle(struct bundle_header *header, const char *path,
* Make sure the refs we wrote out is correct; --max-count and
* other limiting options could have prevented all the tips
* from getting output.
+ *
+ * Non commit objects such as tags and blobs do not have
+ * this issue as they are not affected by those extra
+ * constraints.
*/
- if (!(e->item->flags & SHOWN)) {
+ if (!(e->item->flags & SHOWN) && e->item->type == OBJ_COMMIT) {
warning("ref '%s' is excluded by the rev-list options",
e->name);
continue;