Skip to content
Snippets Groups Projects

Fix issue when switching branch when BLOB is shown

Merged gitlab-qa-bot requested to merge github/fork/Deradon/fix-blob-switching into master

Created by: Deradon

This fix one issue of #3666 (closed).

When browsing a project, and showing a file, if you try to switch to another branch this result in an error.

This commit should fix it.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Created by: Andrepuel

    This did not fix the issue for me. Are you missing any changes?

    By Administrator on 2013-04-22T22:38:18 (imported from GitLab project)

    By Administrator on 2013-04-22T22:38:18 (imported from GitLab)

  • Created by: Deradon

    Ah, it only fixes it, if you show the file via HTML request, not ajax. (Aka calling URL directly, w/o browsing around)

    Will have a look how to fix it ...

    By Administrator on 2013-04-22T22:43:32 (imported from GitLab project)

    By Administrator on 2013-04-22T22:43:32 (imported from GitLab)

  • Created by: coveralls

    Coverage Status

    Coverage decreased (-0.1%) when pulling 27b4d3a55ba88e7ceb18166230cd6dd0a06fa6b7 on Deradon:fix-blob-switching into 5ac5f586 on gitlabhq:master.

    By Administrator on 2013-04-22T23:06:00 (imported from GitLab project)

    By Administrator on 2013-04-22T23:06:00 (imported from GitLab)

  • Created by: Deradon

    OK, should work for AJAX requests as well.

    By Administrator on 2013-04-22T23:00:06 (imported from GitLab project)

    By Administrator on 2013-04-22T23:00:06 (imported from GitLab)

  • Created by: coveralls

    Coverage Status

    Coverage decreased (-0.1%) when pulling 93dd06fc on Deradon:fix-blob-switching into 5ac5f586 on gitlabhq:master.

    By Administrator on 2013-04-22T23:16:18 (imported from GitLab project)

    By Administrator on 2013-04-22T23:16:18 (imported from GitLab)

  • Created by: coveralls

    Coverage Status

    Coverage decreased (-0.1%) when pulling 93dd06fc on Deradon:fix-blob-switching into 5ac5f586 on gitlabhq:master.

    By Administrator on 2013-04-22T23:20:15 (imported from GitLab project)

    By Administrator on 2013-04-22T23:20:15 (imported from GitLab)

  • Created by: Andrepuel

    It is working like a charm, now!

    Do you know what the follow: true does in the def commits of lib/gitlab/git/repository.rb?

    Because maybe you should add the following patch to your branch:

    diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb
    index ddead51..a0ab682 100644
    --- a/lib/gitlab/git/repository.rb
    +++ b/lib/gitlab/git/repository.rb
    @@ -68,8 +68,8 @@ module Gitlab
           end
    
           def commits(ref, path = nil, limit = nil, offset = nil)
             if path.present?
    -          repo.log(ref, path, max_count: limit, skip: offset, follow: true)
    +          repo.log(ref, path, max_count: limit, skip: offset)
             elsif limit && offset
               repo.commits(ref, limit.to_i, offset.to_i)
             else

    By Administrator on 2013-04-23T01:23:09 (imported from GitLab project)

    By Administrator on 2013-04-23T01:23:09 (imported from GitLab)

  • Created by: kirantpatil

    :thumbsup:

    By Administrator on 2013-04-23T04:51:56 (imported from GitLab project)

    By Administrator on 2013-04-23T04:51:56 (imported from GitLab)

  • Created by: Deradon

    I'm not sure, what the intention of the follow: true is. So I won't revert it in this PR.

    By Administrator on 2013-04-23T06:22:44 (imported from GitLab project)

    By Administrator on 2013-04-23T06:22:44 (imported from GitLab)

  • Created by: dzaporozhets

    Looks good. Thank you

    By Administrator on 2013-04-23T07:49:53 (imported from GitLab project)

    By Administrator on 2013-04-23T07:49:53 (imported from GitLab)

Please register or sign in to reply
Loading