fix: ensure users can push from an image-deploy repository and respect deploy-branch

Previously, we created this weird bare repo that didn't do set all the normal git config. This change switches to cloning the local temp directory, fixing the `receive.denyCurrentBranch` property that blocked pushing to this weird bare repo after calling git:from-image or git:from-archive.

Additionally, since we now use a git clone, we set the default branch correctly, ensuring git pushes later on that branch work as expected (and not on master if it was customized prior to app creation).

Closes #5601
Closes #5662
This commit is contained in:
Jose Diaz-Gonzalez
2023-03-20 01:24:12 -04:00
parent 23779c066f
commit 8faa338bd4
3 changed files with 28 additions and 3 deletions

View File

@@ -27,6 +27,30 @@ teardown() {
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "cat /home/dokku/$TEST_APP/HEAD"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "ref: refs/heads/master"
}
@test "(git) git:from-image [normal-custom-branch]" {
run /bin/bash -c "dokku git:set $TEST_APP deploy-branch main"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku git:from-image $TEST_APP linuxserver/foldingathome:7.5.1-ls1"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "cat /home/dokku/$TEST_APP/HEAD"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "ref: refs/heads/main"
}
@test "(git) git:from-image [normal-git-init]" {