[RFC] http clone does not checkout working tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If I try cloning a repository by http with the current 'master', I end
up with a proper git directory, but nothing gets checked out in the
working tree [I see the problem with any repository; I randomly picked
the one in the example below because it is small, and http clone can be
painfully slow]:

  $ git clone http://repo.or.cz/r/bigint.git
  [...]
  $ cd bigint
  $ ls
  $

I think the problem is that the builtin-clone now does the http commit
walking and the tree unpacking in the same process, and the commit
walker leaves the in-core objects in a funny state.

Specifically, the top-level tree object has its "parsed" flag set to 1,
but the buffer and size members are set to NULL and 0, respectively.
This happens in walker.c:process_tree, where we free the tree buffer
after walking it. It seems like we are violating the meaning of "parsed"
here, which implies that those other members are valid.

The following patch fixes it for me, but I really have no idea if there
isn't something more subtle at work. Sending to Linus, since "git blame"
points the surrounding code to you, and to Daniel, since the new clone
and the commit walker are your areas.

---
diff --git a/walker.c b/walker.c
index 31de6c1..0e68ee6 100644
--- a/walker.c
+++ b/walker.c
@@ -59,6 +59,7 @@ static int process_tree(struct walker *walker, struct tree *tree)
 	free(tree->buffer);
 	tree->buffer = NULL;
 	tree->size = 0;
+	tree->object.parsed = 0;
 	return 0;
 }
 
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux