]> git.ipfire.org Git - thirdparty/git.git/blobdiff - reflog-walk.c
The sixth batch
[thirdparty/git.git] / reflog-walk.c
index d216f6f966da91459ea946790be56ba011760170..f11b97e88944f79fecc623e27e88564f5a69c501 100644 (file)
@@ -67,24 +67,32 @@ static struct complete_reflogs *read_complete_reflog(const char *ref)
        struct complete_reflogs *reflogs =
                xcalloc(1, sizeof(struct complete_reflogs));
        reflogs->ref = xstrdup(ref);
        struct complete_reflogs *reflogs =
                xcalloc(1, sizeof(struct complete_reflogs));
        reflogs->ref = xstrdup(ref);
-       for_each_reflog_ent(ref, read_one_reflog, reflogs);
+       refs_for_each_reflog_ent(get_main_ref_store(the_repository), ref,
+                                read_one_reflog, reflogs);
        if (reflogs->nr == 0) {
                const char *name;
                void *name_to_free;
        if (reflogs->nr == 0) {
                const char *name;
                void *name_to_free;
-               name = name_to_free = resolve_refdup(ref, RESOLVE_REF_READING,
-                                                    NULL, NULL);
+               name = name_to_free = refs_resolve_refdup(get_main_ref_store(the_repository),
+                                                         ref,
+                                                         RESOLVE_REF_READING,
+                                                         NULL, NULL);
                if (name) {
                if (name) {
-                       for_each_reflog_ent(name, read_one_reflog, reflogs);
+                       refs_for_each_reflog_ent(get_main_ref_store(the_repository),
+                                                name, read_one_reflog,
+                                                reflogs);
                        free(name_to_free);
                }
        }
        if (reflogs->nr == 0) {
                char *refname = xstrfmt("refs/%s", ref);
                        free(name_to_free);
                }
        }
        if (reflogs->nr == 0) {
                char *refname = xstrfmt("refs/%s", ref);
-               for_each_reflog_ent(refname, read_one_reflog, reflogs);
+               refs_for_each_reflog_ent(get_main_ref_store(the_repository),
+                                        refname, read_one_reflog, reflogs);
                if (reflogs->nr == 0) {
                        free(refname);
                        refname = xstrfmt("refs/heads/%s", ref);
                if (reflogs->nr == 0) {
                        free(refname);
                        refname = xstrfmt("refs/heads/%s", ref);
-                       for_each_reflog_ent(refname, read_one_reflog, reflogs);
+                       refs_for_each_reflog_ent(get_main_ref_store(the_repository),
+                                                refname, read_one_reflog,
+                                                reflogs);
                }
                free(refname);
        }
                }
                free(refname);
        }
@@ -174,7 +182,8 @@ int add_reflog_for_walk(struct reflog_walk_info *info,
        else {
                if (*branch == '\0') {
                        free(branch);
        else {
                if (*branch == '\0') {
                        free(branch);
-                       branch = resolve_refdup("HEAD", 0, NULL, NULL);
+                       branch = refs_resolve_refdup(get_main_ref_store(the_repository),
+                                                    "HEAD", 0, NULL, NULL);
                        if (!branch)
                                die("no current branch");
 
                        if (!branch)
                                die("no current branch");
 
@@ -223,7 +232,7 @@ int add_reflog_for_walk(struct reflog_walk_info *info,
 
 void get_reflog_selector(struct strbuf *sb,
                         struct reflog_walk_info *reflog_info,
 
 void get_reflog_selector(struct strbuf *sb,
                         struct reflog_walk_info *reflog_info,
-                        const struct date_mode *dmode, int force_date,
+                        struct date_mode dmode, int force_date,
                         int shorten)
 {
        struct commit_reflog *commit_reflog = reflog_info->last_commit_reflog;
                         int shorten)
 {
        struct commit_reflog *commit_reflog = reflog_info->last_commit_reflog;
@@ -236,7 +245,9 @@ void get_reflog_selector(struct strbuf *sb,
        if (shorten) {
                if (!commit_reflog->reflogs->short_ref)
                        commit_reflog->reflogs->short_ref
        if (shorten) {
                if (!commit_reflog->reflogs->short_ref)
                        commit_reflog->reflogs->short_ref
-                               = shorten_unambiguous_ref(commit_reflog->reflogs->ref, 0);
+                               = refs_shorten_unambiguous_ref(get_main_ref_store(the_repository),
+                                                              commit_reflog->reflogs->ref,
+                                                              0);
                printed_ref = commit_reflog->reflogs->short_ref;
        } else {
                printed_ref = commit_reflog->reflogs->ref;
                printed_ref = commit_reflog->reflogs->short_ref;
        } else {
                printed_ref = commit_reflog->reflogs->ref;
@@ -297,7 +308,7 @@ timestamp_t get_reflog_timestamp(struct reflog_walk_info *reflog_info)
 }
 
 void show_reflog_message(struct reflog_walk_info *reflog_info, int oneline,
 }
 
 void show_reflog_message(struct reflog_walk_info *reflog_info, int oneline,
-                        const struct date_mode *dmode, int force_date)
+                        struct date_mode dmode, int force_date)
 {
        if (reflog_info && reflog_info->last_commit_reflog) {
                struct commit_reflog *commit_reflog = reflog_info->last_commit_reflog;
 {
        if (reflog_info && reflog_info->last_commit_reflog) {
                struct commit_reflog *commit_reflog = reflog_info->last_commit_reflog;