|
|
@ -127,11 +127,11 @@ func (repo *Repository) UpdateRepoFile(doer *User, opts UpdateRepoFileOptions) ( |
|
|
|
|
|
|
|
|
|
|
|
if err = git.AddChanges(localPath, true); err != nil { |
|
|
|
if err = git.AddChanges(localPath, true); err != nil { |
|
|
|
return fmt.Errorf("git add --all: %v", err) |
|
|
|
return fmt.Errorf("git add --all: %v", err) |
|
|
|
} |
|
|
|
} else if err = git.CommitChanges(localPath, git.CommitChangesOptions{ |
|
|
|
|
|
|
|
Committer: doer.NewGitSig(), |
|
|
|
signaure := doer.NewGitSig() |
|
|
|
Message: opts.Message, |
|
|
|
if err = git.CommitChanges(localPath, opts.Message, signaure); err != nil { |
|
|
|
}); err != nil { |
|
|
|
return fmt.Errorf("git commit -m %s --author='%s <%s>': %v", opts.Message, signaure.Name, signaure.Email, err) |
|
|
|
return fmt.Errorf("CommitChanges: %v", err) |
|
|
|
} else if err = git.Push(localPath, "origin", opts.NewBranch); err != nil { |
|
|
|
} else if err = git.Push(localPath, "origin", opts.NewBranch); err != nil { |
|
|
|
return fmt.Errorf("git push origin %s: %v", opts.NewBranch, err) |
|
|
|
return fmt.Errorf("git push origin %s: %v", opts.NewBranch, err) |
|
|
|
} |
|
|
|
} |
|
|
@ -254,11 +254,11 @@ func (repo *Repository) DeleteRepoFile(doer *User, opts DeleteRepoFileOptions) ( |
|
|
|
|
|
|
|
|
|
|
|
if err = git.AddChanges(localPath, true); err != nil { |
|
|
|
if err = git.AddChanges(localPath, true); err != nil { |
|
|
|
return fmt.Errorf("git add --all: %v", err) |
|
|
|
return fmt.Errorf("git add --all: %v", err) |
|
|
|
} |
|
|
|
} else if err = git.CommitChanges(localPath, git.CommitChangesOptions{ |
|
|
|
|
|
|
|
Committer: doer.NewGitSig(), |
|
|
|
signaure := doer.NewGitSig() |
|
|
|
Message: opts.Message, |
|
|
|
if err = git.CommitChanges(localPath, opts.Message, signaure); err != nil { |
|
|
|
}); err != nil { |
|
|
|
return fmt.Errorf("git commit -m %s --author='%s <%s>': %v", opts.Message, signaure.Name, signaure.Email, err) |
|
|
|
return fmt.Errorf("CommitChanges: %v", err) |
|
|
|
} else if err = git.Push(localPath, "origin", opts.Branch); err != nil { |
|
|
|
} else if err = git.Push(localPath, "origin", opts.Branch); err != nil { |
|
|
|
return fmt.Errorf("git push origin %s: %v", opts.Branch, err) |
|
|
|
return fmt.Errorf("git push origin %s: %v", opts.Branch, err) |
|
|
|
} |
|
|
|
} |
|
|
|