#!/bin/sh # # Copyright (c) 2008 Dmitry V. Levin # global test_description := ''fetch exit status test'' source ./test-lib.sh test_expect_success setup ' >file && git add file && git commit -m initial && git checkout -b side && echo side >file && git commit -a -m side && git checkout master && echo next >file && git commit -a -m next ' test_expect_success 'non-fast-forward fetch' ' test_must_fail git fetch . master:side ' test_expect_success 'forced update' ' git fetch . +master:side ' test_done (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"fetch exit status test">)} spids: [13] ) ] spids: [13] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(setup)} { (SQ <"\n"> <"\n"> <"\t>file &&\n"> <"\tgit add file &&\n"> <"\tgit commit -m initial &&\n"> <"\n"> <"\tgit checkout -b side &&\n"> <"\techo side >file &&\n"> <"\tgit commit -a -m side &&\n"> <"\n"> <"\tgit checkout master &&\n"> <"\techo next >file &&\n"> <"\tgit commit -a -m next\n"> ) } ) (C {(test_expect_success)} {(SQ <"non-fast-forward fetch">)} {(SQ <"\n"> <"\n"> <"\ttest_must_fail git fetch . master:side\n"> <"\n">)} ) (C {(test_expect_success)} {(SQ <"forced update">)} {(SQ <"\n"> <"\n"> <"\tgit fetch . +master:side\n"> <"\n">)} ) (C {(test_done)}) ] )