The branch field is null when retrieving the changesets through API

Andrei Ionescu avatarAndrei Ionescu created an issue

I'm retrieving 20 changests through changesets API and all items have the branch field/property set to null:

For example this is an item:

{
    "node": "0ca18f230ebe",
    "files":  [
     {
      "type": "modified",
      "file": "testfolder/sub1/sub1-1/a1.txt"
    }
    ],
    "branches":  [],
    "raw_author": "Andrei Ionescu <webdev.andrei@gmail.com>",
    "utctimestamp": "2013-01-02 20:36:01+00:00",
    "author": "andrei_ionescu",
    "timestamp": "2013-01-02 21:36:01",
    "raw_node": "0ca18f230ebe0968adf1d9778a1cc287f7015a6f",
    "parents":  [
    "a1772c8c7473"
    ],
    "branch": null,
    "message": "testing clean dirs. v11.\n",
    "revision": null,
    "size": -1
},

As you can see there is:

"branch": null,

This is my API call: https://api.bitbucket.org/1.0/repositories/andrei_ionescu/deploy-test/changesets/?limit=20

Why is it null? Is there something wrong that I did?

Comments (5)

  1. Brian Nguyen

    Hi Andrei,

    Part of how Git branching works is that the branch is only applied to the head. Any parents of that head, while technically part of the branch are not actually labelled that way.

    123    456
     |_____|
     |
    789
    

    For example, in the example above commits, 123 and 456 will have a branch but 789 will not.

    So in your repository, the last commit is the only one that has the branch master. Everything else is none.

    In contrast, Mercurial's branch system does keep track of the branch with every commit.

    I hope this helps.

    Cheers, Brian

  2. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.