Re: Problem with cg-clone

From: Junio C Hamano <junkio@cox.net>
Date: 2005-10-30 06:59:31
Marcel Holtmann <marcel@holtmann.org> writes:

> I installed the latest git and cogito from their repositories and now
> the local clone command is failing:
>
> # cg-clone linux-2.6 test-2.6
> defaulting to local storage area
> Using hard links
> `/data/kernel/linux-2.6/.git/HEAD' -> `.git/refs/heads/.origin-fetching'
> error: Couldn't find 8a212ab6b8a4ccc6f3c3d1beba5f92655c576404: not separate or in any pack
> Cannot obtain needed object 8a212ab6b8a4ccc6f3c3d1beba5f92655c576404
> while processing commit 0000000000000000000000000000000000000000.
> cg-fetch: objects fetch failed
> cg-clone: fetch failed

The attached patch should fix git-local-fetch which I think the
above problem is.  git-clone -l -s would be much faster if you
are doing a local clone, however.

---

diff --git a/local-fetch.c b/local-fetch.c
index 87a93de..0a07114 100644
--- a/local-fetch.c
+++ b/local-fetch.c
@@ -52,9 +52,10 @@ static int setup_indices(void)
 	return 0;
 }
 
-static int copy_file(const char *source, const char *dest, const char *hex,
+static int copy_file(const char *source, char *dest, const char *hex,
 		     int warn_if_not_exists)
 {
+	safe_create_leading_directories(dest);
 	if (use_link) {
 		if (!link(source, dest)) {
 			pull_say("link %s\n", hex);
@@ -150,7 +151,7 @@ static int fetch_file(const unsigned cha
 	static int object_name_start = -1;
 	static char filename[PATH_MAX];
 	char *hex = sha1_to_hex(sha1);
-	const char *dest_filename = sha1_file_name(sha1);
+	char *dest_filename = sha1_file_name(sha1);
 
  	if (object_name_start < 0) {
 		strcpy(filename, path); /* e.g. git.git */


-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Sun Oct 30 07:00:47 2005

This archive was generated by hypermail 2.1.8 : 2005-10-30 07:00:51 EST