@@ -18,13 +18,11 @@ static unsigned long expire;
1818static int prune_tmp_object (const char * path , const char * filename )
1919{
2020 const char * fullpath = mkpath ("%s/%s" , path , filename );
21- if (expire ) {
22- struct stat st ;
23- if (lstat (fullpath , & st ))
24- return error ("Could not stat '%s'" , fullpath );
25- if (st .st_mtime > expire )
26- return 0 ;
27- }
21+ struct stat st ;
22+ if (lstat (fullpath , & st ))
23+ return error ("Could not stat '%s'" , fullpath );
24+ if (st .st_mtime > expire )
25+ return 0 ;
2826 printf ("Removing stale temporary file %s\n" , fullpath );
2927 if (!show_only )
3028 unlink_or_warn (fullpath );
@@ -34,13 +32,11 @@ static int prune_tmp_object(const char *path, const char *filename)
3432static int prune_object (char * path , const char * filename , const unsigned char * sha1 )
3533{
3634 const char * fullpath = mkpath ("%s/%s" , path , filename );
37- if (expire ) {
38- struct stat st ;
39- if (lstat (fullpath , & st ))
40- return error ("Could not stat '%s'" , fullpath );
41- if (st .st_mtime > expire )
42- return 0 ;
43- }
35+ struct stat st ;
36+ if (lstat (fullpath , & st ))
37+ return error ("Could not stat '%s'" , fullpath );
38+ if (st .st_mtime > expire )
39+ return 0 ;
4440 if (show_only || verbose ) {
4541 enum object_type type = sha1_object_info (sha1 , NULL );
4642 printf ("%s %s\n" , sha1_to_hex (sha1 ),
@@ -139,6 +135,7 @@ int cmd_prune(int argc, const char **argv, const char *prefix)
139135 };
140136 char * s ;
141137
138+ expire = ULONG_MAX ;
142139 save_commit_buffer = 0 ;
143140 read_replace_refs = 0 ;
144141 init_revisions (& revs , prefix );
0 commit comments