merged create_reference and create_reference_symbolic and added force-Option

To be more pythonic: merged methods create_reference and create_reference_symbolic
and added force-Option. To make a new symbolic reference you have provide symbolic=True
as an additional parameter. If force=True references will although be overridden.
Otherwise an exception is raised if the references exists.

Examples:

  # normal reference
    repo.create_reference('refs/heads/foo', repo.head.hex)

  # override reference with new value
    repo.create_reference('refs/heads/foo', repo.head.hex, force=True)

  # symbolic reference
    repo.create_reference('refs/tags/foo', 'refs/heads/master', symbolic = True)
use latest development of libgit2 - changed GitError to ValueError

For already existing references a ValueError is raised (see sry/pygit2/error.c:41)
config: update Config_get_multivar_fn_wrapper to use git_config_entry *.

This fixes:

  $ python setup.py build_ext --inplace
  ...
  src/pygit2/config.c: In function ‘Config_get_multivar’:
  src/pygit2/config.c:311:13: warning: passing argument 4 of ‘git_config_get_multivar’ from incompatible pointer type
  ../libgit2/include/git2/config.h:339:17: note: expected ‘int (*)(const struct git_config_entry *, void *)’ but argument is of type ‘int (*)(const char *, void *)’
  error: command 'i686-pc-linux-gnu-gcc' failed with exit status 1

reported by wolftankk in issue #140.

Signed-off-by: W. Trevor King <wking@tremily.us>
config: add force argument to Config_add_file.

This fixes:

  src/pygit2/config.c: In function ‘Config_add_file’:
  src/pygit2/config.c:276:5: error: too few arguments to function ‘git_config_add_file_ondisk’

Also convert `int priority` -> `unsigned int level` to match current
libgit2 header.

Signed-off-by: W. Trevor King <wking@tremily.us>
config: update Config_foreach_callback_wrapper to use git_config_entry *.

This fixes:

  $ python setup.py build_ext --inplace
  src/pygit2/config.c: In function ‘Config_foreach’:
  src/pygit2/config.c:261:13: warning: passing argument 2 of ‘git_config_foreach’ from incompatible pointer type
  ../libgit2/include/git2/config.h:420:17: note: expected ‘int (*)(const struct git_config_entry *, void *)’ but argument is of type ‘int (*)(const char *, const char *, void *)’

Signed-off-by: W. Trevor King <wking@tremily.us>
diff: add const to shared pointers in the diff API.

This brings us into compliance with the libgit2 commit:

  commit bae957b95d59a840df72a725b06f00635471cfd8
  Author: Russell Belfer <rb@github.com>
  Date:   Tue Sep 25 16:31:46 2012 -0700

    Add const to all shared pointers in diff API

Signed-off-by: W. Trevor King <wking@tremily.us>
index: remove read_tree() progress indicator

This brings us into compliance with the libgit2 commit:

  commit 0ae81fc479bf3cf7ed31b3e3b070de7990102f1d
  Author: nulltoken <emeric.fermas@gmail.com>
  Date:   Wed Oct 17 15:30:22 2012 +0200

    index: remove read_tree() progress indicator

Signed-off-by: W. Trevor King <wking@tremily.us>
config: extend Config.add_file() accept keyword arguments.

This provides backward compatibility with older code that does not
specify `force`.

Signed-off-by: W. Trevor King <wking@tremily.us>
config: check for Py_BuildValue() errors in Config_foreach_callback_wrapper().

Signed-off-by: W. Trevor King <wking@tremily.us>
config: return -1 on error in Config_foreach_callback_wrapper().

Config_foreach_callback_wrapper is supposed to return 0 on success.
From the docstring:

  As soon as one of the callbacks returns an integer other than 0,
  this function returns that value.

If we've already had an exception, we want to bail immediately and
raise the exception.

Signed-off-by: W. Trevor King <wking@tremily.us>
config: fix return conversion in Config_foreach_callback_wrapper()

PyLong_AsLong() returns -1 on error.  The previous implementation
returned -1 when py_result was 0, which killed every .foreach()
iteration after the first callback.

We could skip the if clause and just return the result of
PyLong_AsLong(), but keeping the if clause makes it more obvious that
we *did* think about handling errors from PyLong_AsLong().

Signed-off-by: W. Trevor King <wking@tremily.us>
test_config: tell Nose that foreach_test_wrapper() is not a test

Signed-off-by: W. Trevor King <wking@tremily.us>
setup.py: decode README.rst to unicode.

Signed-off-by: W. Trevor King <wking@tremily.us>
Merge pull request #141 from wking/libgit2

Fix compilation issues against recent versions of libgit2
Merge pull request #142 from wking/readme-encoding

setup.py: decode README.rst to unicode.
fixed index_add and index_get for current development branch of libgit2
fixed warning gcc -Wparentheses warning
fixed config test for config.set_multivar

config files have different priorities and only the highest one gets evaluated for set_multivar
added Index_remove
fixed api changes: git_tree_create_fromindex to git_index_write_tree