Imported Upstream version 2.21.0
[platform/upstream/git.git] / t / helper / test-dump-untracked-cache.c
index f752532..cf0f2c7 100644 (file)
@@ -1,3 +1,5 @@
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
+#include "test-tool.h"
 #include "cache.h"
 #include "dir.h"
 
@@ -23,7 +25,7 @@ static void dump(struct untracked_cache_dir *ucd, struct strbuf *base)
        len = base->len;
        strbuf_addf(base, "%s/", ucd->name);
        printf("%s %s", base->buf,
-              sha1_to_hex(ucd->exclude_sha1));
+              oid_to_hex(&ucd->exclude_oid));
        if (ucd->recurse)
                fputs(" recurse", stdout);
        if (ucd->check_only)
@@ -38,7 +40,7 @@ static void dump(struct untracked_cache_dir *ucd, struct strbuf *base)
        strbuf_setlen(base, len);
 }
 
-int cmd_main(int ac, const char **av)
+int cmd__dump_untracked_cache(int ac, const char **av)
 {
        struct untracked_cache *uc;
        struct strbuf base = STRBUF_INIT;
@@ -54,8 +56,8 @@ int cmd_main(int ac, const char **av)
                printf("no untracked cache\n");
                return 0;
        }
-       printf("info/exclude %s\n", sha1_to_hex(uc->ss_info_exclude.sha1));
-       printf("core.excludesfile %s\n", sha1_to_hex(uc->ss_excludes_file.sha1));
+       printf("info/exclude %s\n", oid_to_hex(&uc->ss_info_exclude.oid));
+       printf("core.excludesfile %s\n", oid_to_hex(&uc->ss_excludes_file.oid));
        printf("exclude_per_dir %s\n", uc->exclude_per_dir);
        printf("flags %08x\n", uc->dir_flags);
        if (uc->root)