From c37073cbc682504243a20e34ba35b46878500fec Mon Sep 17 00:00:00 2001 From: Alex Galonsky Date: Sun, 18 Aug 2013 05:00:42 +0000 Subject: [PATCH] Using git rev-parse --show-toplevel to find repo root --- lib/git/status_shortcuts.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/git/status_shortcuts.rb b/lib/git/status_shortcuts.rb index 9f2e4e3..f0e3287 100644 --- a/lib/git/status_shortcuts.rb +++ b/lib/git/status_shortcuts.rb @@ -20,7 +20,7 @@ # # groups => 1: staged, 2: unmerged, 3: unstaged, 4: untracked # -------------------------------------------------------------------- -@project_root = File.exist?(".git") ? Dir.pwd : `\git rev-parse --git-dir 2> /dev/null`.sub(/\/\.git$/, '').strip +@project_root = File.exist?(".git") ? Dir.pwd : `\git rev-parse --show-toplevel 2> /dev/null`.strip @git_status = `\git status --porcelain 2> /dev/null`