summaryrefslogtreecommitdiff
path: root/builtin/ls-tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/ls-tree.c')
-rw-r--r--builtin/ls-tree.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/builtin/ls-tree.c b/builtin/ls-tree.c
index 8cc8c995df..077977a461 100644
--- a/builtin/ls-tree.c
+++ b/builtin/ls-tree.c
@@ -5,6 +5,9 @@
*/
#include "cache.h"
#include "config.h"
+#include "gettext.h"
+#include "hex.h"
+#include "object-name.h"
#include "object-store.h"
#include "blob.h"
#include "tree.h"
@@ -228,7 +231,7 @@ static int show_tree_default(const struct object_id *oid, struct strbuf *base,
return early;
printf("%06o %s %s\t", mode, type_name(object_type(mode)),
- find_unique_abbrev(oid, options->abbrev));
+ repo_find_unique_abbrev(the_repository, oid, options->abbrev));
show_tree_common_default_long(options, base, pathname, base->len);
return recurse;
}
@@ -259,7 +262,8 @@ static int show_tree_long(const struct object_id *oid, struct strbuf *base,
}
printf("%06o %s %s %7s\t", mode, type_name(type),
- find_unique_abbrev(oid, options->abbrev), size_text);
+ repo_find_unique_abbrev(the_repository, oid, options->abbrev),
+ size_text);
show_tree_common_default_long(options, base, pathname, base->len);
return recurse;
}
@@ -310,7 +314,7 @@ static int show_tree_object(const struct object_id *oid, struct strbuf *base,
if (early >= 0)
return early;
- str = find_unique_abbrev(oid, options->abbrev);
+ str = repo_find_unique_abbrev(the_repository, oid, options->abbrev);
if (options->null_termination) {
fputs(str, stdout);
fputc('\0', stdout);
@@ -433,7 +437,7 @@ int cmd_ls_tree(int argc, const char **argv, const char *prefix)
ls_tree_usage, ls_tree_options);
if (argc < 1)
usage_with_options(ls_tree_usage, ls_tree_options);
- if (get_oid(argv[0], &oid))
+ if (repo_get_oid(the_repository, argv[0], &oid))
die("Not a valid object name %s", argv[0]);
/*