This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
hours_ago = ARGV.shift | |
recovery_dir = ARGV.shift | |
Dir.mkdir(recovery_dir) unless File.exists?(recovery_dir) | |
# find all objects that were created less than X hours ago | |
files = `find .git/objects -type f -atime -#{hours_ago}h`.split("\n") |