8 require 'nos_oignons/git'
9 require 'nos_oignons/subscriptions'
11 if system('git rev-parse --quiet --verify HEAD >/dev/null')
14 # Initial commit: diff against an empty tree object
15 against = '4b825dc642cb6eb9a060e54bf8d69288fbee4904'
18 IO.popen(['git', 'diff-index', '--cached', '--name-status', against]) do |io|
19 handle_modified_files(io) do |file|
20 next unless file.start_with?("#{SUBSCRIPTIONS_ROOT}/")
21 # Use empty ref to get the index
22 if !is_valid_subscription_file?('', file)
23 $stderr.puts "Désolé : #{file} n'a pas le bon format !"