receive-pack: Send hook output over side band #2
[gitweb.git] / t / t5400-send-pack.sh
index d6151f885476e9c4f0f90c3c102f9fa41576e74c..f2d5581b12f7d70c9f346da75dced81e12bd4c7f 100755 (executable)
@@ -190,4 +190,17 @@ test_expect_success 'pushing wildcard refspecs respects forcing' '
        test "$parent_head" = "$child_head"
 '
 
+test_expect_success 'warn pushing to delete current branch' '
+       rewound_push_setup &&
+       (
+           cd child &&
+           git send-pack ../parent :refs/heads/master 2>errs
+       ) &&
+       grep "warning: to refuse deleting" child/errs &&
+       (
+               cd parent &&
+               test_must_fail git rev-parse --verify master
+       )
+'
+
 test_done