diff options
author | Stefan Beller <sbeller@google.com> | 2018-05-18 00:51:46 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-05-18 01:13:10 +0200 |
commit | c88134870e8b2da084e37fb86ff88fb7d7617d61 (patch) | |
tree | ccc6e0b810e3e986d69652538b05dfe24c0c0a35 /builtin/rev-parse.c | |
parent | shallow: add repository argument to check_shallow_file_for_update (diff) | |
download | git-c88134870e8b2da084e37fb86ff88fb7d7617d61.tar.xz git-c88134870e8b2da084e37fb86ff88fb7d7617d61.zip |
shallow: add repository argument to is_repository_shallow
Add a repository argument to allow callers of is_repository_shallow
to be more specific about which repository to handle. This is a small
mechanical change; it doesn't change the implementation to handle
repositories other than the_repository yet.
As with the previous commits, use a macro to catch callers passing a
repository other than the_repository at compile time.
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/rev-parse.c')
-rw-r--r-- | builtin/rev-parse.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c index 36b2087782..a8a9b506ff 100644 --- a/builtin/rev-parse.c +++ b/builtin/rev-parse.c @@ -879,7 +879,8 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix) continue; } if (!strcmp(arg, "--is-shallow-repository")) { - printf("%s\n", is_repository_shallow() ? "true" + printf("%s\n", + is_repository_shallow(the_repository) ? "true" : "false"); continue; } |