remote.c: simply a bit of code using git_config_string()

A small segment where handle_config() parses the branch.remote
configuration variable can be simplified using git_config_string().
Make this simplification so that we may have an opportunity to free an
existing value in *dest before assigning it a value.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
remote.c: introduce a way to have different remotes for fetch/ push

Currently, do_push() in push.c calls remote_get(), which gets the
configured remote for fetching and pushing.  Replace this call with a
call to pushremote_get() instead, a new function that will return the
remote configured specifically for pushing.  This function tries to
work with the string pushremote_name, before falling back to the
codepath of remote_get().  This patch has no visible impact, but
serves to enable future patches to introduce configuration variables
to set this variable.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
remote.c: introduce branch.<name>.pushremote

This new configuration variable overrides the remote in
`branch.<name>.remote` for pushes.  It is useful in the typical
scenario, where the remote I'm pulling from is not the remote I'm
pushing to.  Although `remote.<name>.pushurl` is similar, it does not
serve the purpose as the URL would lack corresponding remote tracking
branches.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
config.c: free *dest in git_config_string()

Before writing a new value, we can safely free the variable.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>