Re: [PATCH v2 12/12] t5520: check reflog action in fast-forward merge
- From
Stefan Beller <sbeller@google.com>
- Date
- May 7, 2015, 16:39 UTC
- Message-ID
- <CAGZ79kaUCp=8JKSspqetzEGFMF7FVvCvFwO9v+A_XtiEd_V=fw@mail.gmail.com>
- In-Reply-To
- <1430988248-18285-13-git-send-email-pyokagan@gmail.com>
On Thu, May 7, 2015 at 1:44 AM, Paul Tan <pyokagan@gmail.com> wrote:
Show 32 quoted lines
> When testing a fast-forward merge with git-pull, check to see if the > reflog action is "pull" with the arguments passed to git-pull. > > While we are in the vicinity, remove the empty line as well. > > Signed-off-by: Paul Tan <pyokagan@gmail.com> > --- > > Notes: > * Added this test to the patch series. > > t/t5520-pull.sh | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh > index b93b735..6045491 100755 > --- a/t/t5520-pull.sh > +++ b/t/t5520-pull.sh > @@ -86,7 +86,6 @@ test_expect_success 'pulling into void must not create an octopus' ' > ' > > test_expect_success 'test . as a remote' ' > - > git branch copy master && > git config branch.copy.remote . && > git config branch.copy.merge refs/heads/master && > @@ -95,7 +94,11 @@ test_expect_success 'test . as a remote' ' > git checkout copy && > test `cat file` = file && > git pull && > - test `cat file` = updated > + test `cat file` = updated &&
same as in patch 1
Show 23 quoted lines
> + git reflog -1 >reflog.actual &&
> + sed "s/$_x05[0-9a-f]*/OBJID/g" reflog.actual >reflog.fuzzy &&
> + echo "OBJID HEAD@{0}: pull: Fast-forward" >reflog.expected &&
> + test_cmp reflog.expected reflog.fuzzy
> '
>
> test_expect_success 'the default remote . should not break explicit pull' '
> @@ -106,7 +109,11 @@ test_expect_success 'the default remote . should not break explicit pull' '
> git reset --hard HEAD^ &&
> test `cat file` = file &&
> git pull . second &&
> - test `cat file` = modified
> + test `cat file` = modified &&
> + git reflog -1 >reflog.actual &&
> + sed "s/$_x05[0-9a-f]*/OBJID/g" reflog.actual >reflog.fuzzy &&
> + echo "OBJID HEAD@{0}: pull . second: Fast-forward" >reflog.expected &&
> + test_cmp reflog.expected reflog.fuzzy
> '
>
> test_expect_success 'fail if wildcard spec does not match any refs' '
> --
> 2.1.4
>The series looks good to me apart from the minor nits.
Thanks, Stefan