shithub: front

ref: 3167f5f7e3d2363ab57a107c838e1c5ef1fcda80
dir: /sys/src/cmd/git/test/export.rc/

View raw version
#!/bin/rc

. ./util.rc

rm -fr scratch
mkdir -p scratch
cd scratch

# setup test repo
@{
	rfork ne
	q git/init a

	cd a
	echo hello > a
	echo goodbye > b
	q git/add a b
	q git/commit -m v1 .
	cd ..
	pwd
	q git/clone `{pwd}^/a b
}

echo @@ export and apply @@
@{
	rfork ne
	@{
		cd b
		echo hihi > b
		q git/commit -m export1 b
		git/export > ../export1.patch
	}

	@{
		cd a
		q git/import ../export1.patch
	}
}

~ `{cd a && git/query HEAD} `{cd b && git/query HEAD} || die 'mismatched export'