summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-09-25 15:24:10 +0900
committerJunio C Hamano <gitster@pobox.com>2017-09-25 15:24:10 +0900
commit3430fff768b526a8e5877cfe56760d4865350b5e (patch)
tree762013bf1a7b9c5352d8af87e7a5a74debf82117 /builtin
parent9709ffac8004c3dc62dc946af469ec6d69bfeffb (diff)
parent417abfde3534ad51a1a47e00ed799e40e3f7b4ae (diff)
downloadgit-3430fff768b526a8e5877cfe56760d4865350b5e.tar.gz
Merge branch 'ow/rev-parse-is-shallow-repo'
"git rev-parse" learned "--is-shallow-repository", that is to be used in a way similar to existing "--is-bare-repository" and friends. * ow/rev-parse-is-shallow-repo: rev-parse: rev-parse: add --is-shallow-repository
Diffstat (limited to 'builtin')
-rw-r--r--builtin/rev-parse.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c
index 9f24004c0a..b9c13d3d9d 100644
--- a/builtin/rev-parse.c
+++ b/builtin/rev-parse.c
@@ -868,6 +868,11 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
: "false");
continue;
}
+ if (!strcmp(arg, "--is-shallow-repository")) {
+ printf("%s\n", is_repository_shallow() ? "true"
+ : "false");
+ continue;
+ }
if (!strcmp(arg, "--shared-index-path")) {
if (read_cache() < 0)
die(_("Could not read the index"));