define('bitbucket/internal/feature/branch-info/commit', [
    'jquery',
    'bitbucket/internal/feature/branch-info/common',
    'bitbucket/internal/model/page-state',
    'bitbucket/internal/widget/list-branches-help-dialog',
    'exports'
], function (
    $,
    branchInfo,
    pageState,
    listBranchesDialog,
    exports
) {
    exports.fetchContext = function(ctx) {
        branchInfo.queryBranchInfoAndDecorate(
            ctx,
            '#branch-info-placeholder',
            feature.stash.branchInfo.commit.details,
            feature.stash.branchInfo.commit.failed,
            function($decoration) {
                $decoration.removeClass('hidden');
            });
    };

    $(document).ready(function() {
       $('#content').on('click', '.branch-info-list-help-trigger', function(e) {
            e.preventDefault();
            listBranchesDialog.showFor(pageState.getCommit().getId());
        });
    });
});
