Re: tracking repository

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> Daniel Barkalow <barkalow@xxxxxxxxxxxx> writes:
>
>> Is "refs/*:refs/*" (mirror everything, including weird stuff) supposed to 
>> be prohibited?
>
> No.  In fact "remote add --mirror" actively creates such.  See my other
> message about design level issues.

I think something like this is needed.  It still has an independent issue
that this is now called by "git remote show" or "git remote prune", and it
will die with a nonsense "refusing to create" error message, though.

The error, as far as I can tell, is half about a misconfigured config
(e.g. "fetch = refs/heads/*:refs/remotes/[]?/*") and half about screwy
remote repository (e.g. a misnamed "[]?" branch on the remote end can try
to update a broken "refs/remotes/origin/[]?" even the configuration is a
perfectly valid "fetch = refs/heads/*:refs/remotes/origin/*").  It may
make sense to reword the error message to "ignoring" from "refusing" and
do just that without dying here.  I dunno.

 remote.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/remote.c b/remote.c
index f3f7375..fbcb03c 100644
--- a/remote.c
+++ b/remote.c
@@ -1007,9 +1007,12 @@ int get_fetch_map(const struct ref *remote_refs,
 	}
 
 	for (rm = ref_map; rm; rm = rm->next) {
-		if (rm->peer_ref && check_ref_format(rm->peer_ref->name + 5))
-			die("* refusing to create funny ref '%s' locally",
-			    rm->peer_ref->name);
+		if (rm->peer_ref) {
+			int st = check_ref_format(rm->peer_ref->name + 5);
+			if (st && st != CHECK_REF_FORMAT_ONELEVEL)
+				die("* refusing to create funny ref '%s'"
+				    " locally", rm->peer_ref->name);
+		}
 	}
 
 	if (ref_map)
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux