From: Junio C Hamano Date: Tue, 23 Sep 2008 09:05:35 +0000 (-0700) Subject: Merge branch 'maint' X-Git-Tag: v1.6.1-rc1~218 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/c4275591fbb7d582c397b228e38dbb8419c89330?ds=inline;hp=-c Merge branch 'maint' * maint: builtin-prune.c: prune temporary packs in /pack directory Do not perform cross-directory renames when creating packs --- c4275591fbb7d582c397b228e38dbb8419c89330 diff --combined builtin-pack-objects.c index 5fc1b8c6fb,4004e73e40..1158e42cba --- a/builtin-pack-objects.c +++ b/builtin-pack-objects.c @@@ -465,7 -465,7 +465,7 @@@ static void write_pack_file(void char tmpname[PATH_MAX]; int fd; snprintf(tmpname, sizeof(tmpname), - "%s/tmp_pack_XXXXXX", get_object_directory()); + "%s/pack/tmp_pack_XXXXXX", get_object_directory()); fd = xmkstemp(tmpname); pack_tmp_name = xstrdup(tmpname); f = sha1fd(fd, pack_tmp_name); @@@ -1725,14 -1725,6 +1725,14 @@@ static void prepare_pack(int window, in if (entry->type < 0) die("unable to get type of object %s", sha1_to_hex(entry->idx.sha1)); + } else { + if (entry->type < 0) { + /* + * This object is not found, but we + * don't have to include it anyway. + */ + continue; + } } delta_list[n++] = entry; diff --combined fast-import.c index ccdf2e57b0,5473cd4d62..ab6689a64d --- a/fast-import.c +++ b/fast-import.c @@@ -376,7 -376,7 +376,7 @@@ static void dump_marks_helper(FILE *, u static void write_crash_report(const char *err) { - char *loc = git_path("fast_import_crash_%d", getpid()); + char *loc = git_path("fast_import_crash_%"PRIuMAX, (uintmax_t) getpid()); FILE *rpt = fopen(loc, "w"); struct branch *b; unsigned long lu; @@@ -390,8 -390,8 +390,8 @@@ fprintf(stderr, "fast-import: dumping crash report to %s\n", loc); fprintf(rpt, "fast-import crash report:\n"); - fprintf(rpt, " fast-import process: %d\n", getpid()); - fprintf(rpt, " parent process : %d\n", getppid()); + fprintf(rpt, " fast-import process: %"PRIuMAX"\n", (uintmax_t) getpid()); + fprintf(rpt, " parent process : %"PRIuMAX"\n", (uintmax_t) getppid()); fprintf(rpt, " at %s\n", show_date(time(NULL), 0, DATE_LOCAL)); fputc('\n', rpt); @@@ -816,7 -816,7 +816,7 @@@ static void start_packfile(void int pack_fd; snprintf(tmpfile, sizeof(tmpfile), - "%s/tmp_pack_XXXXXX", get_object_directory()); + "%s/pack/tmp_pack_XXXXXX", get_object_directory()); pack_fd = xmkstemp(tmpfile); p = xcalloc(1, sizeof(*p) + strlen(tmpfile) + 2); strcpy(p->pack_name, tmpfile); @@@ -878,7 -878,7 +878,7 @@@ static char *create_index(void } snprintf(tmpfile, sizeof(tmpfile), - "%s/tmp_idx_XXXXXX", get_object_directory()); + "%s/pack/tmp_idx_XXXXXX", get_object_directory()); idx_fd = xmkstemp(tmpfile); f = sha1fd(idx_fd, tmpfile); sha1write(f, array, 256 * sizeof(int));