prune: clean .git/shallow after pruning objects
This patch teaches "prune" to remove shallow roots that are no longer reachable from any refs (e.g. when the relevant refs are removed). Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
0d7d285f0e
commit
eab3296c7e
@ -170,5 +170,9 @@ int cmd_prune(int argc, const char **argv, const char *prefix)
|
||||
s = mkpathdup("%s/pack", get_object_directory());
|
||||
remove_temporary_files(s);
|
||||
free(s);
|
||||
|
||||
if (is_repository_shallow())
|
||||
prune_shallow(show_only);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user