git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Problem with cg-clone

From
Junio C Hamano <junkio@cox.net>
Date
Oct 29, 2005, 19:59 UTC
Message-ID
<7vwtjwytzw.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<1130605726.5396.39.camel@blade>
Marcel Holtmann <marcel@holtmann.org> writes:
Show 12 quoted lines
> 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 */
Previous: Linus TorvaldsNext: Marcel Holtmann
Message 4 of 6 in “Problem with cg-clone”
  1. Marcel HoltmannOct 29, 2005
  2. Junio C HamanoOct 29, 2005
  3. Linus TorvaldsOct 29, 2005
  4. Junio C HamanoOct 29, 2005
  5. Marcel HoltmannOct 29, 2005
  6. Junio C HamanoOct 29, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.