(t *testing.T, remoteDir, fileName, fileContent, commitMessage string)
| 654 | } |
| 655 | |
| 656 | func createRemoteCommit(t *testing.T, remoteDir, fileName, fileContent, commitMessage string) { |
| 657 | // Clone the bare repository to a temporary working directory |
| 658 | workingDir := t.TempDir() |
| 659 | cmd := exec.Command("git", "clone", remoteDir, workingDir) |
| 660 | err := cmd.Run() |
| 661 | require.NoError(t, err, "failed to clone remote repository") |
| 662 | setupGitConfig(t, workingDir) |
| 663 | |
| 664 | // Create and commit the file in the working directory |
| 665 | createCommit(t, workingDir, fileName, fileContent, commitMessage) |
| 666 | |
| 667 | // Push the changes back to the remote repository |
| 668 | cmd = exec.Command("git", "-C", workingDir, "push", "origin", "HEAD") |
| 669 | err = cmd.Run() |
| 670 | require.NoError(t, err, "failed to push changes to remote repository") |
| 671 | } |
| 672 | |
| 673 | // createRemoteMergeCommit builds a merge commit on the remote by cloning it, |
| 674 | // creating a feature branch and a divergent commit, then merging with --no-ff and pushing. |
no test coverage detected