Skip to content

Commit

Permalink
fix(plugins/memosplusplugin/utils/githubutil.cs): gitHubUtil.UpdateFi…
Browse files Browse the repository at this point in the history
…le: 文件内容未变, 放弃提交
  • Loading branch information
yiyungent committed Mar 5, 2023
1 parent 3c858dc commit bb5c2b5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugins/MemosPlusPlugin/Utils/GitHubUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ public void UpdateFile(string repoOwner, string repoName, string repoBranch, str
if (existingFile != null && existingFile.Count >= 1)
{
existFile = true;
// string oldFileContent = existingFile.First().Content;
string oldFileContent = existingFile.First().Content;
if (oldFileContent == fileContent) {
System.Console.WriteLine("GitHubUtil.UpdateFile: 文件内容未变, 放弃提交");
return;
}
// update the file
var updateChangeSet = gitHubClient.Repository.Content.UpdateFile(owner, repo, targetFilePath,
new UpdateFileRequest(message: $"{nameof(MemosPlusPlugin)} {DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}",
Expand Down

0 comments on commit bb5c2b5

Please sign in to comment.