diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-05-23 16:06:07 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-05-23 16:06:07 -0700 |
commit | 182fb4df9120257c2e6b041dd58eef3de5b530d2 (patch) | |
tree | d24989f220fef3b241a367f22ee0aad7fabe4c0b /builtin-send-pack.c | |
parent | e5e9714a106ab668ac982cf73f31919eb4e354fd (diff) | |
parent | a83619d692deeb2565335144078465acb2dd1457 (diff) | |
download | git-182fb4df9120257c2e6b041dd58eef3de5b530d2.tar.gz git-182fb4df9120257c2e6b041dd58eef3de5b530d2.tar.xz |
Merge branch 'pb/push'
* pb/push:
add special "matching refs" refspec
Diffstat (limited to 'builtin-send-pack.c')
-rw-r--r-- | builtin-send-pack.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/builtin-send-pack.c b/builtin-send-pack.c index bb9c33a65..d76260c09 100644 --- a/builtin-send-pack.c +++ b/builtin-send-pack.c @@ -537,9 +537,17 @@ static void verify_remote_names(int nr_heads, const char **heads) int i; for (i = 0; i < nr_heads; i++) { + const char *local = heads[i]; const char *remote = strrchr(heads[i], ':'); - remote = remote ? (remote + 1) : heads[i]; + if (*local == '+') + local++; + + /* A matching refspec is okay. */ + if (remote == local && remote[1] == '\0') + continue; + + remote = remote ? (remote + 1) : local; switch (check_ref_format(remote)) { case 0: /* ok */ case CHECK_REF_FORMAT_ONELEVEL: |