X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=bundle.c;h=00b2aabefca49b634f49143523ee31556baa7777;hb=d317851a7fd07f28890e6dc9bc2269da37c4122e;hp=0ba5df17e15d679b03fe38af40260c118c9588fa;hpb=31c6390d40fe12a46c38d7224da61c6771886f2a;p=git.git diff --git a/bundle.c b/bundle.c index 0ba5df17e..00b2aabef 100644 --- a/bundle.c +++ b/bundle.c @@ -178,6 +178,7 @@ int create_bundle(struct bundle_header *header, const char *path, int i, ref_count = 0; char buffer[1024]; struct rev_info revs; + int read_from_stdin = 0; struct child_process rls; FILE *rls_fout; @@ -227,8 +228,16 @@ int create_bundle(struct bundle_header *header, const char *path, /* write references */ argc = setup_revisions(argc, argv, &revs, NULL); - if (argc > 1) - return error("unrecognized argument: %s'", argv[1]); + + for (i = 1; i < argc; i++) { + if (!strcmp(argv[i], "--stdin")) { + if (read_from_stdin++) + die("--stdin given twice?"); + read_revisions_from_stdin(&revs); + continue; + } + return error("unrecognized argument: %s'", argv[i]); + } for (i = 0; i < revs.pending.nr; i++) { struct object_array_entry *e = revs.pending.objects + i;