[PATCH] When a remote is added but not fetched, tell the user.
- From
- Gabriel <g2p.code@gmail.com>
- Date
- Apr 10, 2008, 23:25 UTC
- Message-ID
- <1207869946-17013-1-git-send-email-g2p.code@gmail.com>
- In-Reply-To
- <20080409101428.GA2637@elte.hu>
A helpful message tells the user when a remote was added without being fetched, and how to fetch it.
Our default of not fetching is breaking the users' workflow in the common "let me access this repo" use case. This message alleviates the problem.
Signed-off-by: Gabriel <g2p.code@gmail.com> --- builtin-remote.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/builtin-remote.c b/builtin-remote.c index d77f10a..044215a 100644 --- a/builtin-remote.c +++ b/builtin-remote.c @@ -111,8 +111,16 @@ static int add(int argc, const char **argv) return 1; } - if (fetch && fetch_remote(name)) - return 1; + if (fetch) { + if (fetch_remote(name)) + return 1; + } + else { + printf ("Added remote repository `%s' without fetching it.\n" + "Before accessing the branches of this " + "remote, run `git fetch %s' " + "or `git remote update'.\n", name, name); + } if (master) { strbuf_reset(&buf);
-- 1.5.5.24.geb27