Merge branch 'lt/unitype'
authorJunio C Hamano <junkio@cox.net>
Fri, 14 Jul 2006 22:39:19 +0000 (15:39 -0700)
committerJunio C Hamano <junkio@cox.net>
Fri, 14 Jul 2006 22:39:19 +0000 (15:39 -0700)
* lt/unitype:
builtin-prune.c: forgot TYPE => OBJ changes.
Remove TYPE_* constant macros and use object_type enums consistently.

1  2 
commit.c
upload-pack.c
diff --combined commit.c
index 6ac3bf7554ec92cec2222c1f3a8f7d3565977688,4c5aac8765a541e92b3de25c2118908221e55c6f..77f0ca175c66b0ef0b7ac5b24672b106c6f17178
+++ b/commit.c
@@@ -56,7 -56,7 +56,7 @@@ static struct commit *check_commit(stru
                                   const unsigned char *sha1,
                                   int quiet)
  {
-       if (obj->type != TYPE_COMMIT) {
+       if (obj->type != OBJ_COMMIT) {
                if (!quiet)
                        error("Object %s is a %s, not a commit",
                              sha1_to_hex(sha1), typename(obj->type));
@@@ -86,11 -86,11 +86,11 @@@ struct commit *lookup_commit(const unsi
        if (!obj) {
                struct commit *ret = alloc_commit_node();
                created_object(sha1, &ret->object);
-               ret->object.type = TYPE_COMMIT;
+               ret->object.type = OBJ_COMMIT;
                return ret;
        }
        if (!obj->type)
-               obj->type = TYPE_COMMIT;
+               obj->type = OBJ_COMMIT;
        return check_commit(obj, sha1, 0);
  }
  
@@@ -655,9 -655,6 +655,9 @@@ unsigned long pretty_print_commit(enum 
                        continue;
                }
  
 +              if (!subject)
 +                      body = 1;
 +
                if (is_empty_line(line, &linelen)) {
                        if (!body)
                                continue;
                                continue;
                        if (fmt == CMIT_FMT_SHORT)
                                break;
 -              } else {
 -                      body = 1;
                }
  
                if (subject) {
        /* Make sure there is an EOLN for the non-oneline case */
        if (fmt != CMIT_FMT_ONELINE)
                buf[offset++] = '\n';
 +      /*
 +       * make sure there is another EOLN to separate the headers from whatever
 +       * body the caller appends if we haven't already written a body
 +       */
 +      if (fmt == CMIT_FMT_EMAIL && !body)
 +              buf[offset++] = '\n';
        buf[offset] = '\0';
        return offset;
  }
diff --combined upload-pack.c
index 94aa0dab4866f86f197dc84956db5e19601a603a,2e820c9c85cf750d57760251aa62237a5173c526..f6f5a7e3db6d45f3f174220fff682cd9fbf0ed72
@@@ -51,10 -51,6 +51,10 @@@ static ssize_t send_client_data(int fd
                if (fd == 3)
                        /* emergency quit */
                        fd = 2;
 +              if (fd == 2) {
 +                      xwrite(fd, data, sz);
 +                      return sz;
 +              }
                return safe_write(fd, data, sz);
        }
        p = data;
@@@ -330,7 -326,7 +330,7 @@@ static int got_sha1(char *hex, unsigne
                        o = parse_object(sha1);
                if (!o)
                        die("oops (%s)", sha1_to_hex(sha1));
-               if (o->type == TYPE_COMMIT) {
+               if (o->type == OBJ_COMMIT) {
                        struct commit_list *parents;
                        if (o->flags & THEY_HAVE)
                                return 0;
@@@ -461,7 -457,7 +461,7 @@@ static int send_ref(const char *refname
                o->flags |= OUR_REF;
                nr_our_refs++;
        }
-       if (o->type == TYPE_TAG) {
+       if (o->type == OBJ_TAG) {
                o = deref_tag(o, refname, 0);
                packet_write(1, "%s %s^{}\n", sha1_to_hex(o->sha1), refname);
        }