summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtin/fetch.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 9a3869f4ff..470372552c 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -1156,11 +1156,8 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
die(_("--depth and --unshallow cannot be used together"));
else if (!is_repository_shallow())
die(_("--unshallow on a complete repository does not make sense"));
- else {
- static char inf_depth[12];
- sprintf(inf_depth, "%d", INFINITE_DEPTH);
- depth = inf_depth;
- }
+ else
+ depth = xstrfmt("%d", INFINITE_DEPTH);
}
/* no need to be strict, transport_set_option() will validate it again */