Default branch REST API 404

XMLWordPrintable

    • Type: Suggestion
    • Resolution: Fixed
    • 5.6.0
    • Component/s: None

      Problem Definition

      REST API endpoint for the default branch returns a 404 for empty repositories when just created by Bitbucket:

      projects/pkey/repos/rslug/branches/default
      

      Suggested Solution

      When using the REST point:

      • for empty repos: return the equivalent of the "Not defined" value shown in the webpage (see attached screenshot).
      • for the repos with an invalid default, 404 is legitimate (current behavior)

      Workaround

      Use a try/catch block and post-process the list of 404 repos with /branches to separate the really empty from the misconfigured.

            Assignee:
            Bryan Turner (Inactive)
            Reporter:
            R.S.
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: