gitlabhq/gitlabhq — pull request #8128 by cirosantilli (2014-10-22 07:58:42+00:00)
Title: Fix gitlab shell test preparation reset method

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!