summaryrefslogtreecommitdiff
path: root/builtin/repo.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/repo.c')
-rw-r--r--builtin/repo.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/builtin/repo.c b/builtin/repo.c
index 73d4e27a16..aada476e1c 100644
--- a/builtin/repo.c
+++ b/builtin/repo.c
@@ -1,4 +1,7 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "builtin.h"
+#include "environment.h"
#include "parse-options.h"
#include "quote.h"
#include "refs.h"
@@ -16,6 +19,12 @@ struct field {
get_value_fn *get_value;
};
+static int get_layout_bare(struct repository *repo UNUSED, struct strbuf *buf)
+{
+ strbuf_addstr(buf, is_bare_repository() ? "true" : "false");
+ return 0;
+}
+
static int get_references_format(struct repository *repo, struct strbuf *buf)
{
strbuf_addstr(buf,
@@ -25,6 +34,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 },
{ "references.format", get_references_format },
};