Fix bad behaviour when running post-review within a git-submodule with recent git versions (issue #2526)

Review Request #2960 — Created March 15, 2012 and submitted

Information

RBTools
master

Reviewers

Fix bad behaviour when running post-review within a git-submodule with recent git versions (issue #2526)
--
On recent version of git, .git is not stored in the worktree of the submodule anymore but as as a subdirectory of the top project
$ git rev-parse --git-dir
/home/nmorey/workspace/git/SigmaCToolchain/.git/modules/scdiag
As post-review tries to reach the top directory by chdir to dirname(git_dir)
we end-up into the git directory of the top project so the diff fails.
The idea is to use the --show-toplevel option of git-rev-parse instead (when it exists).
This patch fixes the issue for me

 
chipx86
  1. Looks good. Committing (with a couple small syntax issues fixed). Thanks!
  2. 
      
NM
Review request changed
Status:
Completed
Change Summary:
Pushed to master (8a254f0)