mirror of
https://github.com/thomiceli/opengist.git
synced 2025-07-10 09:51:51 +02:00
Add clickable Markdown checkboxes (#182)
This commit is contained in:
@ -201,7 +201,7 @@ func GetLog(user string, gist string, skip int) ([]*Commit, error) {
|
||||
return parseLog(stdout, truncateLimit), err
|
||||
}
|
||||
|
||||
func CloneTmp(user string, gist string, gistTmpId string, email string) error {
|
||||
func CloneTmp(user string, gist string, gistTmpId string, email string, remove bool) error {
|
||||
repositoryPath := RepositoryPath(user, gist)
|
||||
|
||||
tmpPath := TmpRepositoriesPath()
|
||||
@ -219,11 +219,13 @@ func CloneTmp(user string, gist string, gistTmpId string, email string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// remove every file (and not the .git directory!)
|
||||
if err = removeFilesExceptGit(tmpRepositoryPath); err != nil {
|
||||
return err
|
||||
// remove every file (keep the .git directory)
|
||||
// useful when user wants to edit multiple files from an existing gist
|
||||
if remove {
|
||||
if err = removeFilesExceptGit(tmpRepositoryPath); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
cmd = exec.Command("git", "config", "--local", "user.name", user)
|
||||
cmd.Dir = tmpRepositoryPath
|
||||
if err = cmd.Run(); err != nil {
|
||||
|
@ -272,7 +272,7 @@ func TestInitViaGitInit(t *testing.T) {
|
||||
}
|
||||
|
||||
func commitToBare(t *testing.T, user string, gist string, files map[string]string) {
|
||||
err := CloneTmp(user, gist, gist, "thomas@mail.com")
|
||||
err := CloneTmp(user, gist, gist, "thomas@mail.com", true)
|
||||
require.NoError(t, err, "Could not commit to repository")
|
||||
|
||||
if len(files) > 0 {
|
||||
|
Reference in New Issue
Block a user