Skip to content

Commit

Permalink
Support for git notes (#435)
Browse files Browse the repository at this point in the history
Co-authored-by: Bart Kamphorst <[email protected]>
  • Loading branch information
dometto and bartkamphorst authored Mar 12, 2023
1 parent 285142d commit 8384b51
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion LATEST_CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# 6.0

* Default to local PlantUML server for security. #412. (@manofstick)
* Allow use of default branch name `main` or `master. Resolves https://github.com/gollum/gollum/issues/1813. (@dometto)
* Allow use of default branch name `main` or `master. Resolves https://github.com/gollum/gollum/issues/1813. (@dometto)
* Support use of commit notes in Gollum::Committer. (@dometto, @bartkamphorst)
1 change: 1 addition & 0 deletions lib/gollum-lib/committer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ def commit
@callbacks.each do |cb|
cb.call(self, sha1)
end
@wiki.repo.commit(sha1).note=@options[:note] if @options[:note]
Hook.execute(:post_commit, self, sha1)
sha1
end
Expand Down
17 changes: 17 additions & 0 deletions test/test_committer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,20 @@
@wiki.update_page(page, page.name, format, "# Elrond", commit_details())
end
end

context "Committer with a writable wiki" do
setup do
@path = cloned_testpath("examples/lotr.git")
@wiki = Gollum::Wiki.new(@path)
end

test "supports notes" do
committer = Gollum::Committer.new(@wiki, note: 'My notes')
committer.commit
assert_equal @wiki.repo.head.commit.note, 'My notes'
end

teardown do
FileUtils.rm_rf(@path)
end
end

0 comments on commit 8384b51

Please sign in to comment.