]> git.ipfire.org Git - thirdparty/git.git/blobdiff - oidset.c
config.mak.uname: remove unused NEEDS_SSL_WITH_CURL flag
[thirdparty/git.git] / oidset.c
index 15d4e18c37353bf0f186155de78f1af322fd855c..2d0ab76fb569be21dacc68e66098a4814191325b 100644 (file)
--- a/oidset.c
+++ b/oidset.c
@@ -42,6 +42,12 @@ int oidset_size(struct oidset *set)
 }
 
 void oidset_parse_file(struct oidset *set, const char *path)
+{
+       oidset_parse_file_carefully(set, path, NULL, NULL);
+}
+
+void oidset_parse_file_carefully(struct oidset *set, const char *path,
+                                oidset_parse_tweak_fn fn, void *cbdata)
 {
        FILE *fp;
        struct strbuf sb = STRBUF_INIT;
@@ -66,7 +72,8 @@ void oidset_parse_file(struct oidset *set, const char *path)
                if (!sb.len)
                        continue;
 
-               if (parse_oid_hex(sb.buf, &oid, &p) || *p != '\0')
+               if (parse_oid_hex(sb.buf, &oid, &p) || *p != '\0' ||
+                   (fn && fn(&oid, cbdata)))
                        die("invalid object name: %s", sb.buf);
                oidset_insert(set, &oid);
        }