]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/worktree.c
object-file.h: move declarations for object-file.c functions from cache.h
[thirdparty/git.git] / builtin / worktree.c
index 254283aa6f5716ab2ab83a477972b4630c056b1b..0621f6f708e93bdb8cde70eded330c84755a1e4f 100644 (file)
@@ -1,8 +1,14 @@
 #include "cache.h"
+#include "abspath.h"
 #include "checkout.h"
 #include "config.h"
 #include "builtin.h"
 #include "dir.h"
+#include "environment.h"
+#include "gettext.h"
+#include "hex.h"
+#include "object-file.h"
+#include "object-name.h"
 #include "parse-options.h"
 #include "strvec.h"
 #include "branch.h"
@@ -13,6 +19,7 @@
 #include "submodule.h"
 #include "utf8.h"
 #include "worktree.h"
+#include "wrapper.h"
 #include "quote.h"
 
 #define BUILTIN_WORKTREE_ADD_USAGE \
@@ -552,7 +559,7 @@ static void print_preparing_worktree_line(int detach,
                else
                        fprintf_ln(stderr, _("Preparing worktree (resetting branch '%s'; was at %s)"),
                                  new_branch,
-                                 find_unique_abbrev(&commit->object.oid, DEFAULT_ABBREV));
+                                 repo_find_unique_abbrev(the_repository, &commit->object.oid, DEFAULT_ABBREV));
        } else if (new_branch) {
                fprintf_ln(stderr, _("Preparing worktree (new branch '%s')"), new_branch);
        } else {
@@ -566,7 +573,7 @@ static void print_preparing_worktree_line(int detach,
                        if (!commit)
                                die(_("invalid reference: %s"), branch);
                        fprintf_ln(stderr, _("Preparing worktree (detached HEAD %s)"),
-                                 find_unique_abbrev(&commit->object.oid, DEFAULT_ABBREV));
+                                 repo_find_unique_abbrev(the_repository, &commit->object.oid, DEFAULT_ABBREV));
                }
                strbuf_release(&s);
        }
@@ -756,7 +763,7 @@ static void show_worktree(struct worktree *wt, int path_maxlen, int abbrev_len)
                strbuf_addstr(&sb, "(bare)");
        else {
                strbuf_addf(&sb, "%-*s ", abbrev_len,
-                               find_unique_abbrev(&wt->head_oid, DEFAULT_ABBREV));
+                               repo_find_unique_abbrev(the_repository, &wt->head_oid, DEFAULT_ABBREV));
                if (wt->is_detached)
                        strbuf_addstr(&sb, "(detached HEAD)");
                else if (wt->head_ref) {
@@ -793,7 +800,7 @@ static void measure_widths(struct worktree **wt, int *abbrev, int *maxlen)
 
                if (path_len > *maxlen)
                        *maxlen = path_len;
-               sha1_len = strlen(find_unique_abbrev(&wt[i]->head_oid, *abbrev));
+               sha1_len = strlen(repo_find_unique_abbrev(the_repository, &wt[i]->head_oid, *abbrev));
                if (sha1_len > *abbrev)
                        *abbrev = sha1_len;
        }