Re: [JGit] Push to new Amazon S3 does not work? ("funny refname")
- From
Robin Rosenberg <robin.rosenberg.lists@dewire.com>
- Date
- Mar 7, 2009, 17:50 UTC
- Message-ID
- <200903071850.38045.robin.rosenberg.lists@dewire.com>
- In-Reply-To
- <ff6a9c820903070805m34f792dard6b17d2029e41dfe@mail.gmail.com>
lördag 07 mars 2009 17:05:02 skrev Daniel Cheng <j16sdiz+freenet@gmail.com>:
Show 31 quoted lines
> Pushing to new Amazon S3 repository does not work.
> It say "funny refname" without pushing anything:
>
> <<<<<<<<<
> $ jgit push s3 master
> To amazon-s3://0NQ4APQ8R7S6HQ65TWR2@egitsdiz/1.git
> ! [remote rejected] master -> master (funny refname)
> $ s3cmd la
> DIR s3://egitsdiz/1.git/
> $
> >>>>>>>>>
>
> Any idea what's happening here?
>
>
> The code is in WalkPushConnection.java line 137:
> <<<<<<<<<
> 134 final List<RemoteRefUpdate> updates = new ArrayList<RemoteRefUpdate>();
> 135 for (final RemoteRefUpdate u : refUpdates.values()) {
> 136 final String n = u.getRemoteName();
> 137 if (!n.startsWith("refs/") || !Repository.isValidRefName(n)) {
> 138 u.setStatus(Status.REJECTED_OTHER_REASON);
> 139 u.setMessage("funny refname");
> 140 continue;
> 141 }
> >>>>>>>>>
>
> u.getRemoteName() gives "master" here.
> Removing n.startsWith("refs/") would generate a bad `packed-refs`
> file in later code.
> I tried to fix this, but failed to do so without breaking GitSsh transportsThis is not specific to s3. It seems jgit wants a fully qualified ref for the remote side, so refs/heads/master will work for the other protocols, and I guess s3 too.
- robin