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 NosOignons::Git.handle_modified_files(io) do |file|
20 next unless file.start_with?("#{NosOignons::SUBSCRIPTIONS_ROOT}/")
22 # Use empty ref to get the index
23 NosOignons::Subscription.read_from_git('', file)
25 $stderr.puts "Désolé : #{file} n'a pas le bon format !"