@@ -281,4 +281,34 @@ test_expect_success 'atomic push reports (reject by non-ff)' '
test_cmp expect actual
'
+test_expect_failure 'atomic push reports exit code failure' '
+ write_script receive-pack-wrapper <<-\EOF &&
+ git-receive-pack "$@"
+ exit 1
+ EOF
+ test_must_fail git -C workbench push --atomic \
+ --receive-pack="${SQ}$(pwd)${SQ}/receive-pack-wrapper" \
+ up HEAD:refs/heads/no-conflict 2>err &&
+ cat >expect <<-EOF &&
+ To ../upstream
+ * [new branch] HEAD -> no-conflict
+ error: failed to push some refs to ${SQ}../upstream${SQ}
+ EOF
+ test_cmp expect err
+'
+
+test_expect_failure 'atomic push reports exit code failure with porcelain' '
+ write_script receive-pack-wrapper <<-\EOF &&
+ git-receive-pack "$@"
+ exit 1
+ EOF
+ test_must_fail git -C workbench push --atomic --porcelain \
+ --receive-pack="${SQ}$(pwd)${SQ}/receive-pack-wrapper" \
+ up HEAD:refs/heads/no-conflict-porcelain 2>err &&
+ cat >expect <<-EOF &&
+ error: failed to push some refs to ${SQ}../upstream${SQ}
+ EOF
+ test_cmp expect err
+'
+
test_done