소스 검색

Merge remote-tracking branch 'tor-github/pr/910'

Nick Mathewson 5 년 전
부모
커밋
82b690d7da
2개의 변경된 파일11개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      changes/ticket30033
  2. 7 0
      scripts/git/pre-push.git-hook

+ 4 - 0
changes/ticket30033

@@ -0,0 +1,4 @@
+  o Minor features (developer tooling):
+    - Call pre-commit git hook from pre-push hook to make sure we're
+      running documentation and code style checks before pushing to remote
+      git repository. Implements feature 30033.

+ 7 - 0
scripts/git/pre-push.git-hook

@@ -27,6 +27,13 @@ ref_is_upstream_branch() {
         fi
 }
 
+workdir=$(git rev-parse --show-toplevel)
+if [ -x "$workdir/.git/hooks/pre-commit" ]; then
+  if ! "$workdir"/.git/hooks/pre-commit; then
+    exit 1
+  fi
+fi
+
 # shellcheck disable=SC2034
 while read -r local_ref local_sha remote_ref remote_sha
 do