Don't abort when we just created the tags file

Wed, 03 Apr 2019 09:39:34 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Wed, 03 Apr 2019 09:39:34 -0500
changeset 754
0b6dae901ee5
parent 753
fadb5356ae65
child 755
60ee3259bc01

Don't abort when we just created the tags file

bin/git-ctags file | annotate | diff | comparison | revisions
--- a/bin/git-ctags
+++ b/bin/git-ctags
@@ -33,7 +33,7 @@ end
 open(target, File::RDONLY|File::CREAT, 0644) do |f|
   if running_hook
     exit unless f.flock(File::LOCK_EX|File::LOCK_NB)
-    exit unless (Time.now - f.mtime) > 60
+    exit unless f.size == 0 || (Time.now - f.mtime) > 60
   end
 
   system(<<-CMD) or exit $?.exitstatus

mercurial