die("Corrupt mode in %s", sha1_to_hex(root->sha1));
e->name = to_atom(c, strlen(c));
c += e->name->str_len + 1;
die("Corrupt mode in %s", sha1_to_hex(root->sha1));
e->name = to_atom(c, strlen(c));
c += e->name->str_len + 1;
*c++ = ' ';
strcpy(c, e->name->str_dat);
c += e->name->str_len + 1;
*c++ = ' ';
strcpy(c, e->name->str_dat);
c += e->name->str_len + 1;
c += 20;
}
store_object(OBJ_TREE, buf, c - buf, NULL, root->sha1, 0);
c += 20;
}
store_object(OBJ_TREE, buf, c - buf, NULL, root->sha1, 0);
if (!e->tree)
load_tree(e);
if (tree_content_set(e, slash1 + 1, sha1, mode)) {
if (!e->tree)
load_tree(e);
if (tree_content_set(e, slash1 + 1, sha1, mode)) {
if (tree_content_remove(e, slash1 + 1)) {
if (!e->tree->entry_count)
goto del_entry;
if (tree_content_remove(e, slash1 + 1)) {
if (!e->tree->entry_count)
goto del_entry;
{
struct object_entry *a = *((struct object_entry**)_a);
struct object_entry *b = *((struct object_entry**)_b);
{
struct object_entry *a = *((struct object_entry**)_a);
struct object_entry *b = *((struct object_entry**)_b);
- memcpy(b->sha1, s->sha1, 20);
- memcpy(b->branch_tree.sha1, s->branch_tree.sha1, 20);
+ hashcpy(b->sha1, s->sha1);
+ hashcpy(b->branch_tree.sha1, s->branch_tree.sha1);
} else if (*from == ':') {
unsigned long idnum = strtoul(from + 1, NULL, 10);
struct object_entry *oe = find_mark(idnum);
} else if (*from == ':') {
unsigned long idnum = strtoul(from + 1, NULL, 10);
struct object_entry *oe = find_mark(idnum);
char *buf;
if (oe->type != OBJ_COMMIT)
die("Mark :%lu not a commit", idnum);
char *buf;
if (oe->type != OBJ_COMMIT)
die("Mark :%lu not a commit", idnum);
buf = unpack_entry(oe->offset, &size);
if (!buf || size < 46)
die("Not a valid commit: %s", from);
buf = unpack_entry(oe->offset, &size);
if (!buf || size < 46)
die("Not a valid commit: %s", from);
die("The commit %s is corrupt", sha1_to_hex(b->sha1));
free(buf);
} else if (!get_sha1(from, b->sha1)) {
die("The commit %s is corrupt", sha1_to_hex(b->sha1));
free(buf);
} else if (!get_sha1(from, b->sha1)) {
- if (!memcmp(b->sha1, null_sha1, 20))
- memcpy(b->branch_tree.sha1, null_sha1, 20);
+ if (is_null_sha1(b->sha1))
+ hashclr(b->branch_tree.sha1);
: 2 * strlen(committer)));
sp = body;
sp += sprintf(sp, "tree %s\n", sha1_to_hex(b->branch_tree.sha1));
: 2 * strlen(committer)));
sp = body;
sp += sprintf(sp, "tree %s\n", sha1_to_hex(b->branch_tree.sha1));
sp += sprintf(sp, "parent %s\n", sha1_to_hex(b->sha1));
if (author)
sp += sprintf(sp, "%s\n", author);
sp += sprintf(sp, "parent %s\n", sha1_to_hex(b->sha1));
if (author)
sp += sprintf(sp, "%s\n", author);
} else if (*from == ':') {
from_mark = strtoul(from + 1, NULL, 10);
struct object_entry *oe = find_mark(from_mark);
if (oe->type != OBJ_COMMIT)
die("Mark :%lu not a commit", from_mark);
} else if (*from == ':') {
from_mark = strtoul(from + 1, NULL, 10);
struct object_entry *oe = find_mark(from_mark);
if (oe->type != OBJ_COMMIT)
die("Mark :%lu not a commit", from_mark);