t/t5505-remote: modernize style

Modernize the style of all tests throughout the file:
- Remove spurious blank lines.
- Indent the test body.
- When executing something in a subshell, put the parenthesis on
  separate lines and indent the body.  Also make sure that the first
  statement in the subshell is a 'cd'.
- When redirecting output, replace the > output forms with >output.
- Use the <<-\EOF and <<-EOF forms of heredoc, not <<EOF.  Also, don't
  de-indent the heredoc body.
- When creating an empty file, use : >output form over >output for
  clarity.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
t/t5505-remote: test push-refspec in branches-file

The test "migrate a remote from named file in $GIT_DIR/branches" reads
the branches-file, but only checks that the url and fetch-refspec are
set correctly.  Check that the push-refspec is also set correctly.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
t/t5505-remote: use test_path_is_missing

Replace instances of ! test -f with test_path_is_missing.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
t/t5505-remote: remove dependency on $origin_url

In the tests "migrate a remote from named file in
$GIT_DIR/{remotes,branches}", we are only checking that a configuration
is migrated successfully; it has no correspondence with whether or not
those values do something sensible with other git
operations (fetch/push).  Therefore, there is no need to determine
$origin_url: just substitute it with the constant value "quux".

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
remote: remove dead code in read_branches_file()

The first line of the function checks that the remote-name contains a
slash ('/'), and sets the "slash" variable accordingly.  The only caller
of read_branches_file() is remote_get_1(); the calling codepath is
guarded by valid_remote_nick(), which checks that the remote does not
contain a slash.  Therefore, the "slash" variable can never be set:
remove the dead code that assumes otherwise.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
t/t5505-remote: test url-with-# in branches-file

Add one more test similar to "migrate a remote from named file in
$GIT_DIR/branches" to check that a url with a # can be used to specify
the branch name (as opposed to the constant "master").

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
t/t5516-fetch-push: don't use branches-file

Four tests exercising fetch and push functionality unnecessarily depend
on $GIT_DIR/branches files.  Modern Git does not encourage the use of
those files, and the parser remote.c:read_branches_file() is only
provided for backward compatibility with older repositories.  We already
have tests in t/t5505-remote to verify that the parser works: so,
substitute the $GIT_DIR/branches configuration with an equivalent
gitconfig-style configuration, using the results of those tests.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
t/t5516-fetch-push: use test_config()

Replace the 'git config' calls in tests with test_config for greater
robustness.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
ls-remote doc: fix example invocation on git.git

Under the EXAMPLES section, there is one invocation on the git.git
repository that attempts to list the refs master, pu, and rc.  The ref
rc does not exist in today's repository, so remove it.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
ls-remote doc: rewrite <repository> paragraph

Replace the <repository> paragraph containing specific references to
$GIT_DIR/branches and "." with a generic urls-or-remotes paragraph
referencing the relevant sections in the git-fetch(1) manpage.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
ls-remote doc: don't encourage use of branches-file

One outdated example encourages the use of $GIT_DIR/branches files.
Replace it with an equivalent example using a remote.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
t/t5505-remote: test multiple push/pull in remotes-file

Extend the test "migrate a remote from named file in $GIT_DIR/remotes"
to test that multiple "Push:" and "Pull:" lines in the remotes-file
works as expected.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
t/t5510-fetch: don't use remotes-file

Replace it with the equivalent gitconfig configuration, using the
results of a test in t/t5505-remote.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
t/t5515-fetch-merge-logic: don't use {branches,remotes}-file

Replace it with the equivalent gitconfig configuration, using the
results of the corresponding tests in t/t5505-remote.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
remote: deprecate read_{branches,remotes}_file

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