diff options
author | SZEDER Gábor <szeder.dev@gmail.com> | 2017-02-03 03:48:18 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-02-03 22:18:40 -0800 |
commit | 69a775963b76824511fe4bdaf949f2e44df4b7a5 (patch) | |
tree | ea9831f56bd49a98e07b6a764473ee46fb9de875 /commit.c | |
parent | 5c12f642df48a0ddee24554fbd2067c4958273d8 (diff) | |
download | git-69a775963b76824511fe4bdaf949f2e44df4b7a5.tar.gz |
completion: list refs from remote when remote's name matches a directory
If the remote given to __git_refs() happens to match both the name of
a configured remote and the name of a directory in the current working
directory, then that directory is assumed to be a git repository, and
listing refs from that directory will be attempted. This is wrong,
because in such a situation git commands (e.g. 'git fetch|pull|push
<remote>' whom these refs will eventually be passed to) give
precedence to the configured remote. Therefore, __git_refs() should
list refs from the configured remote as well.
Add the helper function __git_is_configured_remote() that checks
whether its argument matches the name of a configured remote. Use
this helper to decide how to handle the remote passed to __git_refs().
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
0 files changed, 0 insertions, 0 deletions