Merge branch 'jc/log-stdin'

* jc/log-stdin:
  Add trivial tests for --stdin option to log family
  Make --stdin option to "log" family read also pathspecs
  setup_revisions(): do not call get_pathspec() too early
  Teach --stdin option to "log" family
  read_revision_from_stdin(): use strbuf

Conflicts:
	revision.c
This commit is contained in:
Junio C Hamano
2009-11-23 22:30:08 -08:00
8 changed files with 164 additions and 34 deletions

View File

@ -204,7 +204,6 @@ 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;
@ -256,15 +255,8 @@ int create_bundle(struct bundle_header *header, const char *path,
/* write references */
argc = setup_revisions(argc, argv, &revs, NULL);
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]);
}
if (argc > 1)
return error("unrecognized argument: %s'", argv[1]);
object_array_remove_duplicates(&revs.pending);