~ubuntu-branches/ubuntu/karmic/git-core/karmic

« back to all changes in this revision

Viewing changes to diff-no-index.c

  • Committer: Package Import Robot
  • Author(s): Kees Cook
  • Date: 2008-11-13 15:11:17 UTC
  • mfrom: (1.1.30) (18.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20081113151117-1z51cdgqzhun6e6x
Tags: 1:1.6.0.4-1ubuntu1
* Merge from debian experimental, remaining changes:
  - debian/control:
    - Drop recently introduced cvsps build dependency; it's only necessary
      or some self tests, but is in universe (Ubuntu specific).
    - Added libauthen-sasl-perl on Recommends and libnet-smtp-ssl-perl on
      Depends for git-email (debian bug 505636).

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
#include "revision.h"
15
15
#include "log-tree.h"
16
16
#include "builtin.h"
17
 
#include "path-list.h"
 
17
#include "string-list.h"
18
18
 
19
 
static int read_directory(const char *path, struct path_list *list)
 
19
static int read_directory(const char *path, struct string_list *list)
20
20
{
21
21
        DIR *dir;
22
22
        struct dirent *e;
26
26
 
27
27
        while ((e = readdir(dir)))
28
28
                if (strcmp(".", e->d_name) && strcmp("..", e->d_name))
29
 
                        path_list_insert(e->d_name, list);
 
29
                        string_list_insert(e->d_name, list);
30
30
 
31
31
        closedir(dir);
32
32
        return 0;
60
60
 
61
61
        if (S_ISDIR(mode1) || S_ISDIR(mode2)) {
62
62
                char buffer1[PATH_MAX], buffer2[PATH_MAX];
63
 
                struct path_list p1 = {NULL, 0, 0, 1}, p2 = {NULL, 0, 0, 1};
 
63
                struct string_list p1 = {NULL, 0, 0, 1}, p2 = {NULL, 0, 0, 1};
64
64
                int len1 = 0, len2 = 0, i1, i2, ret = 0;
65
65
 
66
66
                if (name1 && read_directory(name1, &p1))
67
67
                        return -1;
68
68
                if (name2 && read_directory(name2, &p2)) {
69
 
                        path_list_clear(&p1, 0);
 
69
                        string_list_clear(&p1, 0);
70
70
                        return -1;
71
71
                }
72
72
 
95
95
                        else if (i2 == p2.nr)
96
96
                                comp = -1;
97
97
                        else
98
 
                                comp = strcmp(p1.items[i1].path,
99
 
                                        p2.items[i2].path);
 
98
                                comp = strcmp(p1.items[i1].string,
 
99
                                        p2.items[i2].string);
100
100
 
101
101
                        if (comp > 0)
102
102
                                n1 = NULL;
103
103
                        else {
104
104
                                n1 = buffer1;
105
 
                                strncpy(buffer1 + len1, p1.items[i1++].path,
 
105
                                strncpy(buffer1 + len1, p1.items[i1++].string,
106
106
                                                PATH_MAX - len1);
107
107
                        }
108
108
 
110
110
                                n2 = NULL;
111
111
                        else {
112
112
                                n2 = buffer2;
113
 
                                strncpy(buffer2 + len2, p2.items[i2++].path,
 
113
                                strncpy(buffer2 + len2, p2.items[i2++].string,
114
114
                                                PATH_MAX - len2);
115
115
                        }
116
116
 
117
117
                        ret = queue_diff(o, n1, n2);
118
118
                }
119
 
                path_list_clear(&p1, 0);
120
 
                path_list_clear(&p2, 0);
 
119
                string_list_clear(&p1, 0);
 
120
                string_list_clear(&p2, 0);
121
121
 
122
122
                return ret;
123
123
        } else {