Re: [PATCHv2 1/2] t5520-pull: Add testcases showing spurious conflicts from git pull --rebase
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Aug 8, 2010, 21:36 UTC
- Message-ID
- <201008082336.18270.j6t@kdbg.org>
- In-Reply-To
- <1281294286-27709-2-git-send-email-newren@gmail.com>
On Sonntag, 8. August 2010, Elijah Newren wrote:
Show 5 quoted lines
> +test_expect_success 'setup for detecting upstreamed changes' ' > + mkdir src && > + (cd src && > + git init && > + for i in $(seq 1 10); do echo $i; done > stuff &&
We don't have seq on Windows. The sequence is short enough to list it explicitly.
Show 6 quoted lines
> + git add stuff && > + git commit -m "Initial revision" > + ) && > + git clone src dst && > + (cd src && > + perl -pi -e s/5/43/ stuff &&
perl -pi is no better than sed -i; it does not work on Windows because it tries to remove an open file (and that is a no-go on Windows). perl -pi.bak does work though.
Show 5 quoted lines
> + git commit -a -m "5->43" && > + perl -pi -e s/6/42/ stuff && > + git commit -a -m "Make it bigger" && > + correct=$(git rev-parse HEAD) > + ) &&
This assignment at the end of the subshell is pointless.
> +test_expect_success 'setup for avoiding reapplying old patches' ' > + (cd dst && > + (git rebase --abort || true) &&
Perhaps:
test_might_fail git rebase --abort &&
but I'm not sure whether that's the intended use of test_might_fail.
> + git reset --hard origin/master > + ) &&
...
> +test_expect_failure 'git pull --rebase does not reapply old patches' ' > + (cd dst && > + (git pull --rebase || true) &&
Ditto.
Show 5 quoted lines
> + test 1 = $(find .git/rebase-apply -name "000*" | wc -l) > + ) > +' > + > test_done
-- Hannes