author | Junio C Hamano <gitster@pobox.com> | |
Mon, 6 Sep 2010 07:11:59 +0000 (00:11 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 6 Sep 2010 07:11:59 +0000 (00:11 -0700) |
* xx/trivial:
tag.c: whitespace breakages fix
Fix whitespace issue in object.c
t5505: add missing &&
tag.c: whitespace breakages fix
Fix whitespace issue in object.c
t5505: add missing &&
1 | 2 | |||
---|---|---|---|---|
object.c | patch | | diff1 | | diff2 | | blob | history |
t/t5505-remote.sh | patch | | diff1 | | diff2 | | blob | history |
tag.c | patch | | diff1 | | diff2 | | blob | history |
diff --cc object.c
index 277b3ddba7dc5387cd97cb35c23d3358727898be,a23fbeaebb530fd434845182113d5a494589ebb1..2eda53cc6144430f5fcf4b93e80fac9b9e147bfd
+++ b/object.c
struct object_list **list_p)
{
struct object_list *new_list = xmalloc(sizeof(struct object_list));
- new_list->item = item;
- new_list->next = *list_p;
- *list_p = new_list;
- return new_list;
+ new_list->item = item;
+ new_list->next = *list_p;
+ *list_p = new_list;
+ return new_list;
}
-void object_list_append(struct object *item,
- struct object_list **list_p)
-{
- while (*list_p) {
- list_p = &((*list_p)->next);
- }
- *list_p = xmalloc(sizeof(struct object_list));
- (*list_p)->next = NULL;
- (*list_p)->item = item;
-}
-
-unsigned object_list_length(struct object_list *list)
-{
- unsigned ret = 0;
- while (list) {
- list = list->next;
- ret++;
- }
- return ret;
-}
-
int object_list_contains(struct object_list *list, struct object *obj)
{
while (list) {
diff --cc t/t5505-remote.sh
Simple merge
diff --cc tag.c
index 85607c219e25d63b0d1f3344649104c60f5b96e2,f2dd1d0e03c28bc7c73639b4d62bb2ba951648f1..28641cf85a0d32357269129f0e8b92bb9e21f399
+++ b/tag.c
return create_object(sha1, OBJ_TAG, alloc_tag_node());
if (!obj->type)
obj->type = OBJ_TAG;
- if (obj->type != OBJ_TAG) {
- error("Object %s is a %s, not a tag",
- sha1_to_hex(sha1), typename(obj->type));
- return NULL;
- }
- return (struct tag *) obj;
+ if (obj->type != OBJ_TAG) {
+ error("Object %s is a %s, not a tag",
+ sha1_to_hex(sha1), typename(obj->type));
+ return NULL;
+ }
+ return (struct tag *) obj;
}
+static unsigned long parse_tag_date(const char *buf, const char *tail)
+{
+ const char *dateptr;
+
+ while (buf < tail && *buf++ != '>')
+ /* nada */;
+ if (buf >= tail)
+ return 0;
+ dateptr = buf;
+ while (buf < tail && *buf++ != '\n')
+ /* nada */;
+ if (buf >= tail)
+ return 0;
+ /* dateptr < buf && buf[-1] == '\n', so strtoul will stop at buf-1 */
+ return strtoul(dateptr, NULL, 10);
+}
+
int parse_tag_buffer(struct tag *item, void *data, unsigned long size)
{
- int typelen, taglen;
unsigned char sha1[20];
- const char *type_line, *tag_line, *sig_line;
char type[20];
- const char *start = data;
+ const char *bufptr = data;
+ const char *tail = bufptr + size;
+ const char *nl;
if (item->object.parsed)
return 0;