I poked around a lot for this, and couldn't find it.
Does Grit already have a method for inspecting a repo's Status for 'Changed and Staged' vs 'Changed and Unstaged'?
From testing some scenarios, it looks like that when a file is 'Changed and Staged', both the sha_repo and sha_index have git hashes.
It looks like if a file is 'Changed and Unstaged', the sha_index is a string of 40 0's - like so: "0000000000000000000000000000000000000000"
It would have been great to find a method in Status to help differentiate these.
Unless I'm missing something?
Oh, and here's a little loop over a Status to demonstrate:
gitrepo = Grit::Repo.new(@repo_root)
status = gitrepo.status
status.changed.each do |file|
# => e3fe9b0197b5e06b3deee41ac99dcd9470044769
# => 0000000000000000000000000000000000000000
Grit is no longer maintained. See #183 and check out libgit2/rugged.