Skip to content

Fix gitlab shell test preparation reset method #8128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

cirosantilli
Copy link
Contributor

Bug introduced by self at: #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: #8086

@TeatroIO
Copy link

I've prepared a stage. Click to open.

@jvanbaarsen
Copy link
Contributor

@cirosantilli Can you please make this mergeable?

@jvanbaarsen
Copy link
Contributor

This merge request has been closed because a request for more information has not been reacted to for more than 2 weeks. If you respond and conform to the merge request guidelines in our contributing guidelines we will reopen this merge request.

@jvanbaarsen jvanbaarsen closed this Feb 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants