diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-07-13 15:15:08 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-07-13 15:15:08 -0700 |
commit | ef567fe70adced1a844088e04dc4b6dd4e83edfb (patch) | |
tree | 49156a9ea7a7692f9586e048a9ca3b200e023b78 | |
parent | Merge branch 'tr/add-i-e' (diff) | |
parent | Teach git-bundle to read revision arguments from stdin like git-rev-list. (diff) | |
download | tgif-ef567fe70adced1a844088e04dc4b6dd4e83edfb.tar.xz |
Merge branch 'ab/bundle'
* ab/bundle:
Teach git-bundle to read revision arguments from stdin like git-rev-list.
-rw-r--r-- | bundle.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -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; |