~ubuntu-branches/ubuntu/edgy/git-core/edgy-backports

« back to all changes in this revision

Viewing changes to list-objects.c

  • Committer: Package Import Robot
  • Author(s): LaMont Jones
  • Date: 2007-11-29 07:28:44 UTC
  • mfrom: (8.1.2 dapper-backports)
  • Revision ID: package-import@ubuntu.com-20071129072844-umsb7y3140yhxkth
Tags: 1:1.5.3.6-1.1~dapper1
* backport to dapper et al.
  - debian/rules changes to support source:Upstream-Version for old dpkg.
  - allow asciidoc (>7.0.2-3)

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
        add_object(obj, p, path, name);
26
26
}
27
27
 
 
28
/*
 
29
 * Processing a gitlink entry currently does nothing, since
 
30
 * we do not recurse into the subproject.
 
31
 *
 
32
 * We *could* eventually add a flag that actually does that,
 
33
 * which would involve:
 
34
 *  - is the subproject actually checked out?
 
35
 *  - if so, see if the subproject has already been added
 
36
 *    to the alternates list, and add it if not.
 
37
 *  - process the commit (or tag) the gitlink points to
 
38
 *    recursively.
 
39
 *
 
40
 * However, it's unclear whether there is really ever any
 
41
 * reason to see superprojects and subprojects as such a
 
42
 * "unified" object pool (potentially resulting in a totally
 
43
 * humongous pack - avoiding which was the whole point of
 
44
 * having gitlinks in the first place!).
 
45
 *
 
46
 * So for now, there is just a note that we *could* follow
 
47
 * the link, and how to do it. Whether it necessarily makes
 
48
 * any sense what-so-ever to ever do that is another issue.
 
49
 */
 
50
static void process_gitlink(struct rev_info *revs,
 
51
                            const unsigned char *sha1,
 
52
                            struct object_array *p,
 
53
                            struct name_path *path,
 
54
                            const char *name)
 
55
{
 
56
        /* Nothing to do */
 
57
}
 
58
 
28
59
static void process_tree(struct rev_info *revs,
29
60
                         struct tree *tree,
30
61
                         struct object_array *p,
49
80
        me.elem = name;
50
81
        me.elem_len = strlen(name);
51
82
 
52
 
        desc.buf = tree->buffer;
53
 
        desc.size = tree->size;
 
83
        init_tree_desc(&desc, tree->buffer, tree->size);
54
84
 
55
85
        while (tree_entry(&desc, &entry)) {
56
86
                if (S_ISDIR(entry.mode))
57
87
                        process_tree(revs,
58
88
                                     lookup_tree(entry.sha1),
59
89
                                     p, &me, entry.path);
 
90
                else if (S_ISGITLINK(entry.mode))
 
91
                        process_gitlink(revs, entry.sha1,
 
92
                                        p, &me, entry.path);
60
93
                else
61
94
                        process_blob(revs,
62
95
                                     lookup_blob(entry.sha1),
137
170
        }
138
171
        for (i = 0; i < objects.nr; i++)
139
172
                show_object(&objects.objects[i]);
 
173
        free(objects.objects);
 
174
        if (revs->pending.nr) {
 
175
                free(revs->pending.objects);
 
176
                revs->pending.nr = 0;
 
177
                revs->pending.alloc = 0;
 
178
                revs->pending.objects = NULL;
 
179
        }
140
180
}