employ new explicit "exists in index?" API
[gitweb.git] / read-cache.c
index 737a27f81b4f46e46cd2107c1c2eca3b5c91e529..b8d3759b53c573075b0bd7af9ff1f7fb29b2715a 100644 (file)
@@ -643,7 +643,7 @@ int add_to_index(struct index_state *istate, const char *path, struct stat *st,
                        if (*ptr == '/') {
                                struct cache_entry *foundce;
                                ++ptr;
-                               foundce = index_name_exists(istate, ce->name, ptr - ce->name, ignore_case);
+                               foundce = index_dir_exists(istate, ce->name, ptr - ce->name);
                                if (foundce) {
                                        memcpy((void *)startPtr, foundce->name + (startPtr - ce->name), ptr - startPtr);
                                        startPtr = ptr;
@@ -652,7 +652,7 @@ int add_to_index(struct index_state *istate, const char *path, struct stat *st,
                }
        }
 
-       alias = index_name_exists(istate, ce->name, ce_namelen(ce), ignore_case);
+       alias = index_file_exists(istate, ce->name, ce_namelen(ce), ignore_case);
        if (alias && !ce_stage(alias) && !ie_match_stat(istate, alias, st, ce_option)) {
                /* Nothing changed, really */
                free(ce);
@@ -1230,14 +1230,14 @@ static struct cache_entry *refresh_cache_entry(struct cache_entry *ce, int reall
 struct ondisk_cache_entry {
        struct cache_time ctime;
        struct cache_time mtime;
-       unsigned int dev;
-       unsigned int ino;
-       unsigned int mode;
-       unsigned int uid;
-       unsigned int gid;
-       unsigned int size;
+       uint32_t dev;
+       uint32_t ino;
+       uint32_t mode;
+       uint32_t uid;
+       uint32_t gid;
+       uint32_t size;
        unsigned char sha1[20];
-       unsigned short flags;
+       uint16_t flags;
        char name[FLEX_ARRAY]; /* more */
 };
 
@@ -1249,15 +1249,15 @@ struct ondisk_cache_entry {
 struct ondisk_cache_entry_extended {
        struct cache_time ctime;
        struct cache_time mtime;
-       unsigned int dev;
-       unsigned int ino;
-       unsigned int mode;
-       unsigned int uid;
-       unsigned int gid;
-       unsigned int size;
+       uint32_t dev;
+       uint32_t ino;
+       uint32_t mode;
+       uint32_t uid;
+       uint32_t gid;
+       uint32_t size;
        unsigned char sha1[20];
-       unsigned short flags;
-       unsigned short flags2;
+       uint16_t flags;
+       uint16_t flags2;
        char name[FLEX_ARRAY]; /* more */
 };