[tor-commits] [tor/master] Early exit from post-merge git hook script when not merging to master

asn at torproject.org asn at torproject.org
Wed Jul 24 09:30:35 UTC 2019


commit 59e523f058ee0953deacf1370d546cabd192584d
Author: rl1987 <rl1987 at sdf.lonestar.org>
Date:   Tue Jul 2 20:06:23 2019 +0300

    Early exit from post-merge git hook script when not merging to master
---
 changes/bug31040                | 3 +++
 scripts/git/post-merge.git-hook | 6 ++++++
 2 files changed, 9 insertions(+)

diff --git a/changes/bug31040 b/changes/bug31040
new file mode 100644
index 000000000..81f6d7e79
--- /dev/null
+++ b/changes/bug31040
@@ -0,0 +1,3 @@
+  o Minor bugfixes (developer tooling):
+    - Only log git script changes in post-merge script when merge was to the
+      master branch. Fixes bug 31040; bugfix on 0.4.1.1-alpha.
diff --git a/scripts/git/post-merge.git-hook b/scripts/git/post-merge.git-hook
index 176b7c9bb..eae4f999e 100755
--- a/scripts/git/post-merge.git-hook
+++ b/scripts/git/post-merge.git-hook
@@ -35,6 +35,12 @@ check_for_script_update() {
         fi
 }
 
+cur_branch=$(git rev-parse --abbrev-ref HEAD)
+if [ "$cur_branch" != "master" ]; then
+  echo "post-merge: Not a master branch. Skipping."
+  exit 0
+fi
+
 check_for_diffs "pre-push"
 check_for_diffs "pre-commit"
 check_for_diffs "post-merge"





More information about the tor-commits mailing list