diff options
author | Junio C Hamano <junkio@cox.net> | 2007-04-24 22:02:38 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-04-24 22:02:38 -0700 |
commit | 61397d4b8da2f2ab3fd767c6058ad05ca10269b8 (patch) | |
tree | e3123467c1be150b7458a297c42ad6ab612e6657 | |
parent | b9d14ffbf1f42eb80231d0378dd2f019a162c054 (diff) | |
parent | 00be8dcc1aca3c1c1a94b39f0563d30d1fa89290 (diff) | |
download | git-61397d4b8da2f2ab3fd767c6058ad05ca10269b8.tar.gz git-61397d4b8da2f2ab3fd767c6058ad05ca10269b8.tar.xz |
Merge branch 'master' of git://repo.or.cz/git/fastimport
* '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
-rwxr-xr-x | contrib/fast-import/import-tars.perl | 7 | ||||
-rw-r--r-- | fast-import.c | 10 |
2 files changed, 15 insertions, 2 deletions
diff --git a/contrib/fast-import/import-tars.perl b/contrib/fast-import/import-tars.perl index 5585a8b2c..184214689 100755 --- a/contrib/fast-import/import-tars.perl +++ b/contrib/fast-import/import-tars.perl @@ -64,7 +64,12 @@ foreach my $tar_file (@ARGV) } 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; diff --git a/fast-import.c b/fast-import.c index cdd629d6b..c4c8cb905 100644 --- a/fast-import.c +++ b/fast-import.c @@ -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) @@ -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) { @@ -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); } @@ -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(); |