jimeh / git-aware-prompt

Display current Git branch name in your terminal prompt when in a Git working directory.
Creative Commons Zero v1.0 Universal
2.16k stars 340 forks source link

Updated to use porcelain Git commands #5

Closed eacousineau closed 11 years ago

eacousineau commented 11 years ago

Updated find_git_branch to use git rev-parse, and updated find_git_dirty to use git diff-files. I think this solves the issue with submodules, and makes it a little more robust (i.e., for feature / release branches from git-flow).

I also changed the function style to reflect what is used in some of git-core, and I removed the preceding space in the branch name (like another Git prompt tutorial had -- forgot the link) for personal preference.

Thank you for this awesome utility!