Skip to content

Commit

Permalink
Merge branch 'master' of git://repo.or.cz/git/fastimport
Browse files Browse the repository at this point in the history
* 'master' of git://repo.or.cz/git/fastimport:
  fast-import: size_t vs ssize_t
  fix importing of subversion tars
  Don't repack existing objects in fast-import
  • Loading branch information
Junio C Hamano committed Apr 25, 2007
2 parents b9d14ff + 00be8dc commit 61397d4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
7 changes: 6 additions & 1 deletion contrib/fast-import/import-tars.perl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@
}
print FI "\n";

my $path = "$prefix$name";
my $path;
if ($prefix) {
$path = "$prefix/$name";
} else {
$path = "$name";
}
$files{$path} = [$next_mark++, $mode];

$commit_time = $mtime if $mtime > $commit_time;
Expand Down
10 changes: 9 additions & 1 deletion fast-import.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ static void fixup_header_footer(void)

buf = xmalloc(buf_sz);
for (;;) {
size_t n = xread(pack_fd, buf, buf_sz);
ssize_t n = xread(pack_fd, buf, buf_sz);
if (!n)
break;
if (n < 0)
Expand Down Expand Up @@ -904,6 +904,12 @@ static int store_object(
if (e->offset) {
duplicate_count_by_type[type]++;
return 1;
} else if (find_sha1_pack(sha1, packed_git)) {
e->type = type;
e->pack_id = MAX_PACK_ID;
e->offset = 1; /* just not zero! */
duplicate_count_by_type[type]++;
return 1;
}

if (last && last->data && last->depth < max_depth) {
Expand Down Expand Up @@ -2021,6 +2027,7 @@ static void import_marks(const char *input_file)
e = insert_object(sha1);
e->type = type;
e->pack_id = MAX_PACK_ID;
e->offset = 1; /* just not zero! */
}
insert_mark(mark, e);
}
Expand Down Expand Up @@ -2086,6 +2093,7 @@ int main(int argc, const char **argv)
if (i != argc)
usage(fast_import_usage);

prepare_packed_git();
start_packfile();
for (;;) {
read_next_command();
Expand Down

0 comments on commit 61397d4

Please sign in to comment.