Merge branch 'maint'
authorJunio C Hamano <gitster@pobox.com>
Tue, 23 Sep 2008 09:05:35 +0000 (02:05 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 23 Sep 2008 09:05:35 +0000 (02:05 -0700)
* maint:
builtin-prune.c: prune temporary packs in <object_dir>/pack directory
Do not perform cross-directory renames when creating packs

1  2 
builtin-pack-objects.c
fast-import.c
diff --combined builtin-pack-objects.c
index 5fc1b8c6fb8273c6957ab9d0d98b9b4150843fc5,4004e73e40db210334fa3ef69b49d07b929f2c99..1158e42cba81e2bdb8640cd6c5a3835453d17e7f
@@@ -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 ccdf2e57b0cf1846996bcda8e89d7d8575a031f6,5473cd4d626c1260cf1a192ab05cc63c37a8fbcb..ab6689a64d69bdb741f662df2038ae1daae99837
@@@ -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;
        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));