~ubuntu-branches/ubuntu/intrepid/git-core/intrepid-updates

« back to all changes in this revision

Viewing changes to mktree.c

  • Committer: Package Import Robot
  • Author(s): Gerrit Pape
  • Date: 2007-04-22 13:31:05 UTC
  • mfrom: (1.1.14)
  • Revision ID: package-import@ubuntu.com-20070422133105-tkmhz328g2p0epz1
Tags: 1:1.5.1.2-1
* new upstream point release.
* debian/changelog.upstream: upstream changes taken from mailing list
  announcement.

Show diffs side-by-side

added added

removed removed

Lines of Context:
95
95
                int len;
96
96
                char *ptr, *ntr;
97
97
                unsigned mode;
98
 
                char type[20];
 
98
                enum object_type type;
99
99
                char *path;
100
100
 
101
101
                read_line(&sb, stdin, line_termination);
115
115
                    ntr[41] != '\t' ||
116
116
                    get_sha1_hex(ntr + 1, sha1))
117
117
                        die("input format error: %s", sb.buf);
118
 
                if (sha1_object_info(sha1, type, NULL))
 
118
                type = sha1_object_info(sha1, NULL);
 
119
                if (type < 0)
119
120
                        die("object %s unavailable", sha1_to_hex(sha1));
120
121
                *ntr++ = 0; /* now at the beginning of SHA1 */
121
 
                if (strcmp(ptr, type))
122
 
                        die("object type %s mismatch (%s)", ptr, type);
 
122
                if (type != type_from_string(ptr))
 
123
                        die("object type %s mismatch (%s)", ptr, typename(type));
123
124
                ntr += 41; /* at the beginning of name */
124
125
                if (line_termination && ntr[0] == '"')
125
126
                        path = unquote_c_style(ntr, NULL);