Re: [PATCH] Make git prune remove temporary packs that look like write failures
- From
Brandon Casey <casey@nrlssc.navy.mil>
- Date
- Feb 6, 2008, 16:48 UTC
- Message-ID
- <47A9E4F9.8050100@nrlssc.navy.mil>
- In-Reply-To
- <alpine.LFD.1.00.0802051357420.2732@xanadu.home>
Nicolas Pitre wrote:
Show 12 quoted lines
> On Tue, 5 Feb 2008, David Steven Tweed wrote: > >> @@ -115,5 +139,6 @@ int cmd_prune(int argc, const char **argv, const char >> *prefix) >> >> sync(); >> prune_packed_objects(show_only); >> + remove_temporary_files(); > > Maybe you could implement the "show_only" mode for > remove_temporary_files() as well? Otherwise the -n option would not be > respected.
I also suggest taking a look at the functions in builtin-prune-packed.c to see how similar functions are implemented there.
Use strlcpy instead of sprintf. Use prefixcmp instead of strncmp. Use same messages as prune_dir() for show_only path and unlink failure. You could also check the opendir call and print a suitable message on failure.
-brandon