[JGit] Push to new Amazon S3 does not work? ("funny refname")
- From
Daniel Cheng <j16sdiz+freenet@gmail.com>
- Date
- Mar 7, 2009, 16:05 UTC
- Message-ID
- <ff6a9c820903070805m34f792dard6b17d2029e41dfe@mail.gmail.com>
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 transports