Issue #6362 resolved

The branch field is null when retrieving the changesets through API

Andrei 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 <>",
    "utctimestamp": "2013-01-02 20:36:01+00:00",
    "author": "andrei_ionescu",
    "timestamp": "2013-01-02 21:36:01",
    "raw_node": "0ca18f230ebe0968adf1d9778a1cc287f7015a6f",
    "parents":  [
    "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:

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

    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