]> git.ipfire.org Git - thirdparty/git.git/blobdiff - fsck.c
l10n: fr v2.23.0 round 2
[thirdparty/git.git] / fsck.c
diff --git a/fsck.c b/fsck.c
index 9878a4b104b0c9336b2c42c2e7c35b647647f65f..cdb7d8db03017e36811e2bf3803ff0a4ca032a3f 100644 (file)
--- a/fsck.c
+++ b/fsck.c
@@ -181,41 +181,6 @@ static int fsck_msg_type(enum fsck_msg_id msg_id,
        return msg_type;
 }
 
-void oidset_parse_file(struct oidset *set, const char *path)
-{
-       FILE *fp;
-       struct strbuf sb = STRBUF_INIT;
-       struct object_id oid;
-
-       fp = fopen(path, "r");
-       if (!fp)
-               die("could not open object name list: %s", path);
-       while (!strbuf_getline(&sb, fp)) {
-               const char *p;
-               const char *name;
-
-               /*
-                * Allow trailing comments, leading whitespace
-                * (including before commits), and empty or whitespace
-                * only lines.
-                */
-               name = strchr(sb.buf, '#');
-               if (name)
-                       strbuf_setlen(&sb, name - sb.buf);
-               strbuf_trim(&sb);
-               if (!sb.len)
-                       continue;
-
-               if (parse_oid_hex(sb.buf, &oid, &p) || *p != '\0')
-                       die("invalid object name: %s", sb.buf);
-               oidset_insert(set, &oid);
-       }
-       if (ferror(fp))
-               die_errno("Could not read '%s'", path);
-       fclose(fp);
-       strbuf_release(&sb);
-}
-
 static int parse_msg_type(const char *str)
 {
        if (!strcmp(str, "error"))
@@ -410,14 +375,14 @@ static int fsck_walk_tree(struct tree *tree, void *data, struct fsck_options *op
                        continue;
 
                if (S_ISDIR(entry.mode)) {
-                       obj = (struct object *)lookup_tree(the_repository, entry.oid);
+                       obj = (struct object *)lookup_tree(the_repository, &entry.oid);
                        if (name && obj)
                                put_object_name(options, obj, "%s%s/", name,
                                        entry.path);
                        result = options->walk(obj, OBJ_TREE, data, options);
                }
                else if (S_ISREG(entry.mode) || S_ISLNK(entry.mode)) {
-                       obj = (struct object *)lookup_blob(the_repository, entry.oid);
+                       obj = (struct object *)lookup_blob(the_repository, &entry.oid);
                        if (name && obj)
                                put_object_name(options, obj, "%s%s", name,
                                        entry.path);
@@ -604,7 +569,7 @@ static int fsck_tree(struct tree *item, struct fsck_options *options)
        o_name = NULL;
 
        while (desc.size) {
-               unsigned mode;
+               unsigned short mode;
                const char *name;
                const struct object_id *oid;
 
@@ -1092,7 +1057,7 @@ int fsck_finish(struct fsck_options *options)
 
                blob = lookup_blob(the_repository, oid);
                if (!blob) {
-                       struct object *obj = lookup_unknown_object(oid->hash);
+                       struct object *obj = lookup_unknown_object(oid);
                        ret |= report(options, obj,
                                      FSCK_MSG_GITMODULES_BLOB,
                                      "non-blob found at .gitmodules");