Added flag GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE to test_repo_init__extended_with_template().

Otherwise the template functionallity is not tested (as a TODO we
also shall test that the specified template really got copied).
Clear local error variable after invoking giterr_clear().
Do not use GIT_CPDIR_CHMOD flag when copying the template.

This is an intermin solution. While this essentially disables the
--shared flag feature, previously external templates did not work
at all. This change fixes the previously corrected, and since
then failing, repo_init__extended_with_template() test.

The problem is now documented in the source code comments.
Now checks in the template test whether the description file has
been properly copied.

This is a minimal effort to test whether the template really has
been used when creating an repo with external templates.
Altered the description of the template.

Before, it was identical to the default template making it difficult
to check, if the proper template was copied an external template
test.
Merge pull request #1242 from sba1/init-with-template-fix

Some fixes for external template support
Merge pull request #1238 from nulltoken/fix/checkout-index

checkout: Teach checkout to cope with orphaned Head
Fix indentations
branch: Introduce git_branch_tracking_name()