title: Composer custom package error : Skipped branch develop, Undefined index: name
body: <p>I am trying to load a small package I made from a remote git repository but i'm still getting the same error whatever I do.</p>
  
  <p>Here is the code of the local composer I am running :</p>
  
  <pre><code>{
  "require": {
      "kdyby/fake-session": "^2.0",
      "monolog/monolog": "^1.19",
  },
  
  "repositories": [
      {
          "type": "git",
          "url": "http://xxxx/master/Core.git" }
  ],
  
  "config": 
      {
          "secure-http": false
      }
  }
  </code></pre>
  
  <p>And this is the remote composer.json :</p>
  
  <pre><code>{
  "repositories": [
      {
          "type": "package",
          "package": {
              "name": "master/core",
              "version": "dev-master",
              "source": {
                  "url": "http://xxxx/master/Core.git",
                  "type": "git",
                  "reference": "origin/develop"
              }
          }
      }
  ],
  "require": {
      "master/core": "dev-master"
      }
  }
  </code></pre>
  
  <p>Here are the logs from my console :</p>
  
  <pre><code>   $ composer require master/Core
     Reading composer.json of http://xxxx/master/Core.git (develop)
     Skipped branch develop, Undefined index: name
  
     [Composer\Repository\InvalidRepositoryException]
     No valid composer.json was found in any branch or tag of http://xxxx/master/Core.git, could not load a package from it.
  </code></pre>
  
  <p>Note that I am trying to get the files from the develop branch and I guess it's reaching the composer.json since it's saying there is an error.</p>
  
  <p>The owner of the repository is "master", that's why there is a master/core, nothing to do here with the master branch.</p>
  
  <p>I've found many issues about undefined index version, but didn't find a working fix for the undefined index name.
  I tried many version of the remote composer file with examples/fixes from the internet, but none worked.</p>
  
  <p>There must be an obvious issue in my files, or something i don't get about composer.
  Thanks for any help.</p>
  
  <p>Edit : solved my issue, i was wrong on which side having which file.</p>
  
  <p>It's working with local composer.json :</p>
  
  <pre><code>{
  "repositories": [
      {
          "type": "package",
          "package": {
              "name": "master/core",
              "version": "dev",
              "source": {
                  "url": "http://xxxx/master/Core.git",
                  "type": "git",
                  "reference": "develop"
              }
          }
      }
  ],
  "require": {
      "master/core": "dev"
      }
  }
  </code></pre>
  
  <p>and remote composer.json :</p>
  
  <pre><code>{
  "name": "master/Core"
  }
  </code></pre>
  
  <p>Note : You must have the composer.json gitted even if working with local files for both (local and remote) or it will not work if you use a "type":"git".</p>