diff --git a/bundle.c b/bundle.c
index e4b2aa9c4a2a7fb52121828343aa27ab47d17279..65ea26bdb8c2cef671030c3a62d87d84612e8144 100644 (file)
--- a/bundle.c
+++ b/bundle.c
int i, ref_count = 0;
char buffer[1024];
struct rev_info revs;
int i, ref_count = 0;
char buffer[1024];
struct rev_info revs;
- int read_from_stdin = 0;
struct child_process rls;
FILE *rls_fout;
struct child_process rls;
FILE *rls_fout;
rls.git_cmd = 1;
if (start_command(&rls))
return -1;
rls.git_cmd = 1;
if (start_command(&rls))
return -1;
- rls_fout = fdopen(rls.out, "r");
+ rls_fout = xfdopen(rls.out, "r");
while (fgets(buffer, sizeof(buffer), rls_fout)) {
unsigned char sha1[20];
if (buffer[0] == '-') {
while (fgets(buffer, sizeof(buffer), rls_fout)) {
unsigned char sha1[20];
if (buffer[0] == '-') {
/* write references */
argc = setup_revisions(argc, argv, &revs, NULL);
/* 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);
object_array_remove_duplicates(&revs.pending);
/* write pack */
argv_pack[0] = "pack-objects";
/* write pack */
argv_pack[0] = "pack-objects";
- argv_pack[1] = "--all-progress";
+ argv_pack[1] = "--all-progress-implied";
argv_pack[2] = "--stdout";
argv_pack[3] = "--thin";
argv_pack[4] = NULL;
argv_pack[2] = "--stdout";
argv_pack[3] = "--thin";
argv_pack[4] = NULL;
close(rls.in);
if (finish_command(&rls))
return error ("pack-objects died");
close(rls.in);
if (finish_command(&rls))
return error ("pack-objects died");
- if (!bundle_to_stdout)
- commit_lock_file(&lock);
+ if (!bundle_to_stdout) {
+ if (commit_lock_file(&lock))
+ die_errno("cannot create '%s'", path);
+ }
return 0;
}
return 0;
}