Re: [PATCH 5/7] t5540-http-push: check existence of fetched files
- From
Clemens Buchacher <drizzd@aon.at>
- Date
- Oct 25, 2009, 16:49 UTC
- Message-ID
- <20091025164913.GA11267@localhost>
- In-Reply-To
- <20091025232227.96769e50.rctay89@gmail.com>
On Sun, Oct 25, 2009 at 11:22:27PM +0800, Tay Ray Chuan wrote:
Show 11 quoted lines
> # By reset, we force git to retrieve the object > (cd "$ROOT_PATH"/fetch_unpacked && > git reset --hard HEAD^ && > git remote rm origin && > git reflog expire --expire=0 --all && > git prune && > - git push -f -v $HTTPD_URL/test_repo_unpacked.git master) > + test ! -e ".git/objects/$COMMIT_PATH" && > + git push -f -v $HTTPD_URL/test_repo_unpacked.git master && > + test -e ".git/objects/$COMMIT_PATH") > '
This fails with smart HTTP. First of all, the objects are packed, so I substituted the above with
! git rev-list -1 $HEAD && git push -f -v $HTTPD_GIT_URL/test_repo_unpacked.git master && git rev-list -1 $HEAD > rev-list.out && test -n rev-list.out
That should be an equivalent test, right? But still, why should push re-fetch the commit we just pruned? Smart HTTP does not do that and therefore fails the last rev-list test:
++ git rev-list -1 9d498b0bbc2a25438e2fbd19081948da86028c23 fatal: bad object 9d498b0bbc2a25438e2fbd19081948da86028c23
Clemens