mirror of
git://git.9front.org/plan9front/plan9front
synced 2025-01-12 11:10:06 +00:00
git/test: improve ftype test (also test dir -> file transition)
The ftype.rc test now tests both: file->dir and dir->file changes.
This commit is contained in:
parent
d03b67430f
commit
1a53aacc60
1 changed files with 20 additions and 9 deletions
29
sys/src/cmd/git/test/ftype.rc
Normal file → Executable file
29
sys/src/cmd/git/test/ftype.rc
Normal file → Executable file
|
@ -11,31 +11,42 @@ echo @@ file-type change @@
|
|||
cd scratch/repo1
|
||||
repo1=`{pwd}
|
||||
$G/init
|
||||
|
||||
# in repo1:
|
||||
# create A as a file
|
||||
# create B as a directory
|
||||
echo A > A
|
||||
mkdir B
|
||||
echo B > B/B
|
||||
$G/add A
|
||||
$G/commit -m 1 A
|
||||
echo C > B/C
|
||||
$G/add A B/C
|
||||
$G/commit -m 1 A B/C
|
||||
|
||||
cd ..
|
||||
$G/clone $repo1 repo2
|
||||
cd repo2
|
||||
repo2=`{pwd}
|
||||
|
||||
diff -r $repo1/A $repo2/A || exit 'clone fail A'
|
||||
diff -r $repo1/B $repo2/B || exit 'clone fail B'
|
||||
|
||||
cd $repo1
|
||||
rm A
|
||||
rm -rf B
|
||||
|
||||
# in repo1:
|
||||
# make A into a directory
|
||||
# make B into a file
|
||||
rm -r A B
|
||||
mkdir A
|
||||
echo B > A/B
|
||||
echo B > B
|
||||
$G/add A/B
|
||||
$G/add B
|
||||
$G/add A/B B
|
||||
$G/commit -m 2 A/B B
|
||||
|
||||
# pull repo2 after file changed to directory in repo1
|
||||
cd $repo2
|
||||
$G/pull
|
||||
|
||||
# make sure A is the same in both repos
|
||||
diff -r $repo1/A $repo2/A || echo fuck
|
||||
diff -r $repo1/A $repo2/A || exit 'pull fail A'
|
||||
diff -r $repo1/B $repo2/B || exit 'pull fail B'
|
||||
|
||||
exit ''
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue