def read_file(file, ref = 'HEAD')
      ensure_repository!
      if has_committed_file?(file)
        # TODO warn if there are unstaged changes.
        `git show #{ref}:#{file}`
      else
        EY.ui.warn <<-WARN
Warn: #{file} is not committed to this git repository:
\t#{root}
This can prevent ey deploy from loading this file for certain server side
deploy-time operations. Commit this file to fix this warning.
        WARN
        root.join(file).read
      end
    end
def read_file(file, ref = 'HEAD')
      ensure_repository!
      if has_committed_file?(file)
        # TODO warn if there are unstaged changes.
        `git show #{ref}:#{file}`
      else
        EY.ui.warn <<-WARN
Warn: #{file} is not committed to this git repository:
\t#{root}
This can prevent ey deploy from loading this file for certain server side
deploy-time operations. Commit this file to fix this warning.
        WARN
        root.join(file).read
      end
    end
Read the committed version at HEAD (or ref) of a file using the git working tree relative filename.
 If the file is not committed, but does exist, a warning will be displayed
 and the file will be read anyway.
 If the file does not exist, returns nil.

 Example:

   read_file('config/ey.yml') # will read $GIT_WORK_TREE/config/ey.yml