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
This commit is contained in:
Junio C Hamano
2017-09-25 15:24:10 +09:00
3 changed files with 23 additions and 0 deletions

View File

@ -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"));