summaryrefslogtreecommitdiff
path: root/tree.c
AgeCommit message (Collapse)AuthorFilesLines
2005-05-07Add git-update-cache --replace option.Libravatar Junio C Hamano1-1/+1
When "path" exists as a file or a symlink in the index, an attempt to add "path/file" is refused because it results in file vs directory conflict. Similarly when "path/file1", "path/file2", etc. exist, an attempt to add "path" as a file or a symlink is refused. With git-update-cache --replace, these existing entries that conflict with the entry being added are automatically removed from the cache, with warning messages. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-05-06[PATCH] don't load and decompress objects twice with parse_object()Libravatar Nicolas Pitre1-17/+27
It turns out that parse_object() is loading and decompressing given object to free it just before calling the specific object parsing function which does mmap and decompress the same object again. This patch introduces the ability to parse specific objects directly from a memory buffer. Without this patch, running git-fsck-cache on the kernel repositorytake: real 0m13.006s user 0m11.421s sys 0m1.218s With this patch applied: real 0m8.060s user 0m7.071s sys 0m0.710s The performance increase is significant, and this is kind of a prerequisite for sane delta object support with fsck. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-05Be more careful about tree entry modes.Libravatar Linus Torvalds1-2/+4
The tree object parsing used to get the executable bit wrong, and didn't know about symlinks. Also, fsck really wants the full mode value so that it can verify the other bits for sanity, so save it all in struct tree_entry.
2005-05-04[PATCH] Fix memory leaks in git-fsck-cacheLibravatar Sergey Vlasov1-2/+7
This patch fixes memory leaks in parse_object() and related functions; these leaks were very noticeable when running git-fsck-cache. Signed-off-by: Sergey Vlasov <vsu@altlinux.ru> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-02Make fsck-cache do better tree checking.Libravatar Linus Torvalds1-5/+0
We check the ordering of the entries, and we verify that none of the entries has a slash in it (this allows us to remove the hacky "has_full_path" member from the tree structure, since we now just test it by walking the tree entries instead).
2005-04-26[PATCH] introduce xmalloc and xreallocLibravatar Christopher Li1-4/+4
Introduce xmalloc and xrealloc to die gracefully with a descriptive message when out of memory, rather than taking a SIGSEGV. Signed-off-by: Christopher Li<chrislgit@chrisli.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-24Don't add references to objects we couldn't find. Libravatar Linus Torvalds1-1/+2
That would SIGSEGV.
2005-04-24Verify that the object type matches for tree/commit objects even before parsing.Libravatar Linus Torvalds1-1/+1
The type doesn't come from the parsing, the type also has to match the usage.
2005-04-24Set object type at object creation time, not object parse time.Libravatar Linus Torvalds1-1/+1
Otherwise we can have objects without a type, which is not good.
2005-04-23[PATCH] Parse tree objects completelyLibravatar Daniel Barkalow1-3/+17
This adds the contents of trees to struct tree. Signed-Off-By: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-22Move "read_tree()" to "tree.c" to be used as a generic helper function.Libravatar Linus Torvalds1-0/+65
Next step: make "diff-cache" use it.
2005-04-18[PATCH] Implementations of parsing functionsLibravatar Daniel Barkalow1-0/+67
This implements the parsing functions. Signed-Off-By: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>