libgit2/libgit2 — pull request #510 by nulltoken (2011-12-14 13:26:58+00:00)
Title: commit: add test to ensure predictability of generation of commit, tree and blob object ids

Replaced the **tree** test with a **commit** one in order to check the commit oid as well.
This has the nice side effect to offer an end to end test usage from initialization of the repository till the first commit.

*Note:* In order to match git oids, it looks like it's mandatory to add a trailing linefeed to the commit message

**Implemented scenario:**

```
$ echo "test" > test.txt
$ git hash-object test.txt
9daeafb9864cf43055ae93beb0afd6c7d144bfa4

$ git add .
$ git commit -m "Initial commit"

$ git log
commit 1fe3126578fc4eca68c193e4a3a0a14a0704624d
Author: nulltoken
Date: Wed Dec 14 08:29:03 2011 +0100

Initial commit

$ git show 1fe3 --format=raw
commit 1fe3126578fc4eca68c193e4a3a0a14a0704624d
tree 2b297e643c551e76cfa1f93810c50811382f9117
author nulltoken 1323847743 +0100
committer nulltoken 1323847743 +0100

Initial commit

diff --git a/test.txt b/test.txt
new file mode 100644
index 0000000..9daeafb
--- /dev/null
+++ b/test.txt
@@ -0,0 +1 @@
+test

$ git ls-tree 2b297
100644 blob 9daeafb9864cf43055ae93beb0afd6c7d144bfa4 test.txt
```