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

« back to all changes in this revision

Viewing changes to merge-tree.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:
57
57
 
58
58
static void *result(struct merge_list *entry, unsigned long *size)
59
59
{
60
 
        char type[20];
 
60
        enum object_type type;
61
61
        struct blob *base, *our, *their;
62
62
 
63
63
        if (!entry->stage)
64
 
                return read_sha1_file(entry->blob->object.sha1, type, size);
 
64
                return read_sha1_file(entry->blob->object.sha1, &type, size);
65
65
        base = NULL;
66
66
        if (entry->stage == 1) {
67
67
                base = entry->blob;
80
80
 
81
81
static void *origin(struct merge_list *entry, unsigned long *size)
82
82
{
83
 
        char type[20];
 
83
        enum object_type type;
84
84
        while (entry) {
85
85
                if (entry->stage == 2)
86
 
                        return read_sha1_file(entry->blob->object.sha1, type, size);
 
86
                        return read_sha1_file(entry->blob->object.sha1, &type, size);
87
87
                entry = entry->link;
88
88
        }
89
89
        return NULL;
188
188
 
189
189
static int unresolved_directory(const char *base, struct name_entry n[3])
190
190
{
191
 
        int baselen;
 
191
        int baselen, pathlen;
192
192
        char *newbase;
193
193
        struct name_entry *p;
194
194
        struct tree_desc t[3];
205
205
        if (!S_ISDIR(p->mode))
206
206
                return 0;
207
207
        baselen = strlen(base);
208
 
        newbase = xmalloc(baselen + p->pathlen + 2);
 
208
        pathlen = tree_entry_len(p->path, p->sha1);
 
209
        newbase = xmalloc(baselen + pathlen + 2);
209
210
        memcpy(newbase, base, baselen);
210
 
        memcpy(newbase + baselen, p->path, p->pathlen);
211
 
        memcpy(newbase + baselen + p->pathlen, "/", 2);
 
211
        memcpy(newbase + baselen, p->path, pathlen);
 
212
        memcpy(newbase + baselen + pathlen, "/", 2);
212
213
 
213
214
        buf0 = fill_tree_descriptor(t+0, n[0].sha1);
214
215
        buf1 = fill_tree_descriptor(t+1, n[1].sha1);