aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2018-11-01 21:58:04 +0100
committerMichał Górny <mgorny@gentoo.org>2019-04-09 13:05:55 +0200
commit01c76c6978bc0b2a667fd35cae150600ace1ea50 (patch)
treeade1f9fb04e0e41b0f53f437235383ff31b2b863 /local/tests/update-06-copyright.sh
parentupdate-06-copyright: Allow for comments in S-o-b (diff)
downloadgithooks-01c76c6978bc0b2a667fd35cae150600ace1ea50.tar.gz
githooks-01c76c6978bc0b2a667fd35cae150600ace1ea50.tar.bz2
githooks-01c76c6978bc0b2a667fd35cae150600ace1ea50.zip
update-06-copyright: Support new/removed branches better
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'local/tests/update-06-copyright.sh')
-rwxr-xr-xlocal/tests/update-06-copyright.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/local/tests/update-06-copyright.sh b/local/tests/update-06-copyright.sh
index 0e0d3be..0b93044 100755
--- a/local/tests/update-06-copyright.sh
+++ b/local/tests/update-06-copyright.sh
@@ -343,4 +343,40 @@ test_failure "${FAIL_NO_SIGNOFF}"
eoutdent
+einfo "Branch addition / removal tests"
+eindent
+
+tbegin "Forked branch with sign-off present"
+git checkout -q -b test-branch
+git commit --allow-empty -m "Commit with sign-off
+
+Signed-off-by: ${GIT_COMMITTER_NAME} <${GIT_COMMITTER_EMAIL}>" -q
+test_branch_success test-branch
+
+tbegin "Forked branch with new non-signed commit"
+git checkout -q -b test-branch
+git commit --allow-empty -m "Commit without sign-off" -q
+test_branch_failure test-branch "${FAIL_NO_SIGNOFF}"
+
+tbegin "Copy of master branch"
+git checkout -q -b test-branch
+test_branch_success test-branch
+
+tbegin "New independent branch with sign-off"
+git checkout --orphan test-branch -q
+git commit --allow-empty -m "Commit with sign-off
+
+Signed-off-by: ${GIT_COMMITTER_NAME} <${GIT_COMMITTER_EMAIL}>" -q
+test_branch_success test-branch
+
+tbegin "New independent branch without sign-off"
+git checkout --orphan test-branch -q
+git commit --allow-empty -m "Commit without sign-off" -q
+test_branch_failure test-branch "${FAIL_NO_SIGNOFF}"
+
+tbegin "Branch removal"
+test_branch_removal
+
+eoutdent
+
exit "${TEST_RET}"