Users can have their own system-wide hook directory (symlink).
That directory (symlink) is copied during git-clone. If we
replace some file in that hook directory it could simply mean that
we replace system-wide hook. So rather replace the hook directory
itself to keep the system-wide hooks untouched.
---
try-fedora-review | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/try-fedora-review b/try-fedora-review
index eb810cc..f805182 100755
--- a/try-fedora-review
+++ b/try-fedora-review
@@ -40,12 +40,10 @@ if cur_branch == "master":
# let's setup a proper git commit hooks so people don't commit ugly code
# accidentally
devnull = open('/dev/null', 'w')
-subprocess.call(['ln', '-s', '../../git-hooks/pre-commit',
- os.path.join(main_dir, '.git/hooks/pre-commit')],
- stderr=devnull)
-subprocess.call(['ln', '-s', '../../git-hooks/post-commit',
- os.path.join(main_dir, '.git/hooks/post-commit')],
- stderr=devnull)
+
+hooks_dir=os.path.join(main_dir, '.git/hooks')
+subprocess.call(['rm', '-rf', hooks_dir], stderr=devnull)
+subprocess.call(['ln', '-s', '../git-hooks', hooks_dir],
stderr=devnull)
review = ReviewHelper()
rc = review.run()
--
1.8.4.2