diff options
Diffstat (limited to 'shallow.c')
-rw-r--r-- | shallow.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -13,10 +13,12 @@ static int is_shallow = -1; static struct stat shallow_stat; static char *alternate_shallow_file; -void set_alternate_shallow_file(const char *path) +void set_alternate_shallow_file(const char *path, int override) { if (is_shallow != -1) die("BUG: is_repository_shallow must not be called before set_alternate_shallow_file"); + if (alternate_shallow_file && !override) + return; free(alternate_shallow_file); alternate_shallow_file = path ? xstrdup(path) : NULL; } |