Re: [PATCH v2 4/4] add: introduce '--resolved' option
Junio C Hamano <[email protected]> Wed, 29 Jul 2026 15:19:53 -0700
| Newsgroups | org.kernel.vger.git |
|---|---|
| Message-ID | <[email protected]> |
Junio C Hamano <[email protected]> writes: > diff --git a/t/t2207-add-resolved.sh b/t/t2207-add-resolved.sh > new file mode 100755 > index 0000000000..f88e3f413e > --- /dev/null > +++ b/t/t2207-add-resolved.sh > @@ -0,0 +1,108 @@ > +#!/bin/sh > + > +test_description='git add --resolved > + > +Test that "git add --resolved" stages conflict-resolved paths and > +refuses to stage when conflict markers remain.' > + > +. ./test-lib.sh > + > +test_expect_success 'setup repo' ' > ... > + git branch topic && > + echo "ours 1" >file1.txt && > + echo "ours 2" >file2.txt && > + echo "ours 3" >file3.txt && > + git commit -a -m ours && > + > + git checkout topic && > + echo "theirs 1" >file1.txt && > + echo "theirs 2" >file2.txt && > + echo "theirs 3" >file3.txt && > + git commit -a -m theirs && > + > + git checkout master > +' This will fail with breaking changes. The last step needs to be git checkout @{-1} to go back to the original branch we were on before checking out the 'topic' branch.