-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show methods for Signatures and Commits
Add `show` methods for `Signature` and `Commit`s in LibGit2. Display the time of the commit using Julia's built-in date handling.
- Loading branch information
Showing
3 changed files
with
14 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -302,6 +302,12 @@ mktempdir() do dir | |
@test cmtr.time == test_sig.time | ||
@test cmtr.email == test_sig.email | ||
@test LibGit2.message(cmt) == commit_msg1 | ||
showstr = split(sprint(show, cmt), "\n") | ||
# the time of the commit will vary so just test the first two parts | ||
@test contains(showstr[1], "Commit Author: Name: TEST, Email: [email protected], Time:") | ||
@test contains(showstr[2], "Committer: Name: TEST, Email: [email protected], Time:") | ||
@test showstr[3] == "Message:" | ||
@test showstr[4] == commit_msg1 | ||
finally | ||
finalize(cmt) | ||
end | ||
|