'
test_expect_success 'git diff-index -p HEAD' '
- tree=$(git write-tree)
+ test_tick &&
+ tree=$(git write-tree) &&
commit=$(echo "Initial commit" | git commit-tree $tree) &&
git update-ref HEAD $commit &&
git diff-index -p HEAD > diff.output &&
test_expect_success 'git resolve now fails' '
git checkout mybranch &&
echo "Work, work, work" >>hello &&
+ test_tick &&
git commit -m "Some work." -i hello &&
git checkout master &&
echo "Play, play, play" >>hello &&
echo "Lots of fun" >>example &&
+ test_tick &&
git commit -m "Some fun." -i hello example &&
test_must_fail git merge -m "Merge work in mybranch" mybranch
EOF
test_expect_success 'git show-branch' '
+ test_tick &&
git commit -m "Merge work in mybranch" -i hello &&
git show-branch --topo-order --more=1 master mybranch \
> show-branch.output &&
cat > resolve.expect << EOF
Updating VARIABLE..VARIABLE
-Fast forward (no commit created; -m option ignored)
+FASTFORWARD (no commit created; -m option ignored)
example | 1 +
hello | 1 +
2 files changed, 2 insertions(+), 0 deletions(-)
test_expect_success 'git resolve' '
git checkout mybranch &&
git merge -m "Merge upstream changes." master |
- sed -e "1s/[0-9a-f]\{7\}/VARIABLE/g" >resolve.output &&
+ sed -e "1s/[0-9a-f]\{7\}/VARIABLE/g" \
+ -e "s/^Fast[- ]forward /FASTFORWARD /" >resolve.output &&
test_cmp resolve.expect resolve.output
'
* [master] Some fun.
! [mybranch] Some work.
--
- + [mybranch] Some work.
* [master] Some fun.
-*+ [mybranch^] Initial commit
+ + [mybranch] Some work.
+*+ [master^] Initial commit
EOF
test_expect_success 'git show-branch (part 4)' '
test_expect_success 'git prune-packed' 'git prune-packed'
test_expect_success '-> only packed objects' '
git prune && # Remove conflict marked blobs
- ! find .git/objects/[0-9a-f][0-9a-f] -type f
+ test $(find .git/objects/[0-9a-f][0-9a-f] -type f -print 2>/dev/null | wc -l) = 0
'
test_done