summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-08-16 05:48:09 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-08-16 19:09:33 (GMT)
commitd920032042c9fb3de04db640afe8611dfd4b6c21 (patch)
treefdebde5dbd61c5b6586a30cb8ff7d522270d773f
parent08b1161697996b5478f726541c0d8a457abcc439 (diff)
downloadgit-d920032042c9fb3de04db640afe8611dfd4b6c21.zip
git-d920032042c9fb3de04db640afe8611dfd4b6c21.tar.gz
git-d920032042c9fb3de04db640afe8611dfd4b6c21.tar.bz2
[PATCH] Fix local pull that uses packs.
The patch mixed up the sha1 for the object being pulled, and the sha1 the pull engine internally use to represent the name of the pack that contains the object being pulled. Signed-off-by: Junio C Hamano <junkio@cox.net>
-rw-r--r--local-pull.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/local-pull.c b/local-pull.c
index 7e47ec0..8b16f50 100644
--- a/local-pull.c
+++ b/local-pull.c
@@ -43,7 +43,7 @@ int setup_indices()
if (namelen != 50 ||
strcmp(de->d_name + namelen - 5, ".pack"))
continue;
- get_sha1_hex(sha1, de->d_name + 5);
+ get_sha1_hex(de->d_name + 5, sha1);
setup_index(sha1);
}
return 0;
@@ -114,11 +114,13 @@ int fetch_pack(unsigned char *sha1)
sha1_to_hex(sha1));
}
sprintf(filename, "%s/objects/pack/pack-%s.pack",
- path, sha1_to_hex(sha1));
- copy_file(filename, sha1_pack_name(sha1), sha1_to_hex(sha1));
+ path, sha1_to_hex(target->sha1));
+ copy_file(filename, sha1_pack_name(target->sha1),
+ sha1_to_hex(target->sha1));
sprintf(filename, "%s/objects/pack/pack-%s.idx",
- path, sha1_to_hex(sha1));
- copy_file(filename, sha1_pack_index_name(sha1), sha1_to_hex(sha1));
+ path, sha1_to_hex(target->sha1));
+ copy_file(filename, sha1_pack_index_name(target->sha1),
+ sha1_to_hex(target->sha1));
install_packed_git(target);
return 0;
}