[PATCH] Warn when send-pack does nothing
- From
Daniel Barkalow <barkalow@iabervon.org>
- Date
- Dec 4, 2005, 16:59 UTC
- Message-ID
- <Pine.LNX.4.64.0512041141280.25300@iabervon.org>
If you try to push into an empty repository with no ref arguments to git push, it doesn't do anything and doesn't say anything. This adds a warning when send-pack isn't going to push anything, so you don't assume that it silently did what you wanted.
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
---
send-pack.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
applies-to: fe523a4df93cce3e5c5b0266b9d3f1cbea009afa 5519af6444d6da0ac55343fe48fe7f68fdb593d9
diff --git a/send-pack.c b/send-pack.c index 3eeb18f..589e1f9 100644 --- a/send-pack.c +++ b/send-pack.c @@ -190,6 +190,12 @@ static int send_pack(int in, int out, in if (match_refs(local_refs, remote_refs, &remote_tail, nr_refspec, refspec, send_all)) return -1; + + if (!remote_refs) { + fprintf(stderr, "No refs in common and none specified; doing nothing.\n"); + return 0; + } + /* * Finally, tell the other end! */ --- 0.99.9.GIT