Skip to content

Instantly share code, notes, and snippets.

@msutter
Created November 5, 2014 17:04
Show Gist options
  • Save msutter/776816f4e44f12facfda to your computer and use it in GitHub Desktop.
Save msutter/776816f4e44f12facfda to your computer and use it in GitHub Desktop.
require 'git'
g = Git.open(working_dir)
untracked_files = gitstatus_untracked_workaround(g)
def gitstatus_untracked_workaround(g)
gem_rubygit_buggy_untracked_files = g.status.untracked.keys
git_files = `git --work-tree=#{g.dir} --git-dir=#{g.dir}/.git ls-files -z -d -m -o -X .gitignore`.split("\x0")
gem_rubygit_buggy_untracked_files & git_files
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment