Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Merge requests
  • !8128

Closed
Created Oct 22, 2014 by Administrator@rootOwner
  • Report abuse
Report abuse

Fix gitlab shell test preparation reset method

  • Overview 3
  • Commits 1
  • Changes 1

Created by: cirosantilli

Bug introduced by self at: https://github.com/gitlabhq/gitlabhq/pull/7823

Before this PR, the test gitlab shell under tmp/tests/gitlab-shell will not correctly fetch new commits if necessary when it exists already (the cache was introduced on the PR that causes this problem: before it would always get removed and cloned).

This happens because the shell.rake sh reset line I wrote was completely wrong because:

  1. bad understanding of git reset --hard: if there is no reference, reset --hard $() will do just git reset --hard, which is valid, and does not activate the ||
  2. bad understanding of precedence: true || echo a && echo b translates to (true || echo a) && echo b, so the fetch part was never done!

Now it works, but is a monster expression. We could split this up into multiple system calls, but that would break the current convention of using sh.

This was extracted from: https://github.com/gitlabhq/gitlabhq/pull/8086

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: github/fork/cirosantilli/fix-gitlab-shell-test-reset