summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <junkio@cox.net>2006-04-26 18:32:45 -0700
committerLibravatar Junio C Hamano <junkio@cox.net>2006-04-26 18:32:45 -0700
commite7afa1115beb071512ac2b8d6b7487eadbfccc74 (patch)
treee1473acf5c9da91c36ab64d8c941fe7bd632090e /t
parentMerge branch 'master' into jc/cache-tree (diff)
parentt0000-basic: more commit-tree tests. (diff)
downloadtgif-e7afa1115beb071512ac2b8d6b7487eadbfccc74.tar.xz
Merge branch 'master' into jc/cache-tree
* master: t0000-basic: more commit-tree tests. commit-tree.c: check_valid() microoptimization. Fix filename verification when in a subdirectory rebase: typofix. socksetup: don't return on set_reuse_addr() error
Diffstat (limited to 't')
-rwxr-xr-xt/t0000-basic.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh
index c69706fb38..cf33989b56 100755
--- a/t/t0000-basic.sh
+++ b/t/t0000-basic.sh
@@ -226,4 +226,32 @@ test_expect_success \
'no diff after checkout and git-update-index --refresh.' \
'git-diff-files >current && cmp -s current /dev/null'
+################################################################
+P=087704a96baf1c2d1c869a8b084481e121c88b5b
+test_expect_success \
+ 'git-commit-tree records the correct tree in a commit.' \
+ 'commit0=$(echo NO | git-commit-tree $P) &&
+ tree=$(git show --pretty=raw $commit0 |
+ sed -n -e "s/^tree //p" -e "/^author /q") &&
+ test "z$tree" = "z$P"'
+
+test_expect_success \
+ 'git-commit-tree records the correct parent in a commit.' \
+ 'commit1=$(echo NO | git-commit-tree $P -p $commit0) &&
+ parent=$(git show --pretty=raw $commit1 |
+ sed -n -e "s/^parent //p" -e "/^author /q") &&
+ test "z$commit0" = "z$parent"'
+
+test_expect_success \
+ 'git-commit-tree omits duplicated parent in a commit.' \
+ 'commit2=$(echo NO | git-commit-tree $P -p $commit0 -p $commit0) &&
+ parent=$(git show --pretty=raw $commit2 |
+ sed -n -e "s/^parent //p" -e "/^author /q" |
+ sort -u) &&
+ test "z$commit0" = "z$parent" &&
+ numparent=$(git show --pretty=raw $commit2 |
+ sed -n -e "s/^parent //p" -e "/^author /q" |
+ wc -l) &&
+ test $numparent = 1'
+
test_done