aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/repo.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/repo.c')
-rw-r--r--builtin/repo.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/builtin/repo.c b/builtin/repo.c
index aada476e1c..3c9140593b 100644
--- a/builtin/repo.c
+++ b/builtin/repo.c
@@ -6,6 +6,7 @@
#include "quote.h"
#include "refs.h"
#include "strbuf.h"
+#include "shallow.h"
static const char *const repo_usage[] = {
"git repo info [<key>...]",
@@ -25,6 +26,13 @@ static int get_layout_bare(struct repository *repo UNUSED, struct strbuf *buf)
return 0;
}
+static int get_layout_shallow(struct repository *repo, struct strbuf *buf)
+{
+ strbuf_addstr(buf,
+ is_repository_shallow(repo) ? "true" : "false");
+ return 0;
+}
+
static int get_references_format(struct repository *repo, struct strbuf *buf)
{
strbuf_addstr(buf,
@@ -35,6 +43,7 @@ static int get_references_format(struct repository *repo, struct strbuf *buf)
/* repo_info_fields keys must be in lexicographical order */
static const struct field repo_info_fields[] = {
{ "layout.bare", get_layout_bare },
+ { "layout.shallow", get_layout_shallow },
{ "references.format", get_references_format },
};