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>
This commit is contained in:
committed by
Junio C Hamano
parent
22bdc7c4ff
commit
c88134870e
@ -1445,7 +1445,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
|
||||
if (unshallow) {
|
||||
if (depth)
|
||||
die(_("--depth and --unshallow cannot be used together"));
|
||||
else if (!is_repository_shallow())
|
||||
else if (!is_repository_shallow(the_repository))
|
||||
die(_("--unshallow on a complete repository does not make sense"));
|
||||
else
|
||||
depth = xstrfmt("%d", INFINITE_DEPTH);
|
||||
|
||||
Reference in New Issue
Block a user