From 82befa65295a86d9903e6bec0d3ea2a62c3de8ca Mon Sep 17 00:00:00 2001 From: Stephen Haberman Date: Sun, 24 Aug 2008 16:08:15 -0500 Subject: [PATCH] Denote what ref we should match, though a symbolic name would be better. --- server/update-stable | 3 +-- tests/t2100-server-update-stable.sh | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/update-stable b/server/update-stable index 64f7369..6c89e51 100644 --- a/server/update-stable +++ b/server/update-stable @@ -36,7 +36,6 @@ # would not have appeared in QA. # -# Command line refname="$1" oldrev="$2" newrev="$3" @@ -88,7 +87,7 @@ changed_lines=$(git diff $second_parent..$newrev | wc -l) if [ "$changed_lines" -ne "0" ] ; then echo "----------------------------------------------------" echo - echo "Moving stable must not result in any changes" + echo "Moving stable must not result in any changes from $second_parent" echo echo "----------------------------------------------------" exit 1 diff --git a/tests/t2100-server-update-stable.sh b/tests/t2100-server-update-stable.sh index 1364f5b..0ec4839 100644 --- a/tests/t2100-server-update-stable.sh +++ b/tests/t2100-server-update-stable.sh @@ -16,7 +16,7 @@ test_expect_success 'setup' ' # setup the update hook install_update_hook 'update-stable' -test_expect_success 'initial stable commit works', ' +test_expect_success 'initial stable commit works' ' # do one stable-less commit echo $test_name >a && git commit -a -m "$test_name" && @@ -107,9 +107,10 @@ test_expect_success 'reject merge with changes' ' # try merging topic4 into stable, which will get a merge commit, but # it should have changes involved and so get rejected git checkout stable && + topic4_hash=$(git rev-parse topic4) && git merge topic4 && ! git push 2>push.err && - cat push.err | grep "Moving stable must not result in any changes" + cat push.err | grep "Moving stable must not result in any changes from $topic4_hash" ' test_done -- 2.20.1