From 0b294c0abf00a9cf7468e0ea62722ae23b0816cc Mon Sep 17 00:00:00 2001 From: Jeff King Date: Tue, 8 Jul 2008 00:08:02 -0400 Subject: make deleting a missing ref more quiet If git attempts to delete a ref, but the unlink of the ref file fails, we print a message to stderr. This is usually a good thing, but if the error is ENOENT, then it indicates that the ref has _already_ been deleted. And since that's our goal, it doesn't make sense to complain to the user. This harmonizes the error reporting behavior for the unpacked and packed cases; the packed case already printed nothing on ENOENT, but the unpacked printed unconditionally. Additionally, send-pack would, when deleting the tracking ref corresponding to a remote delete, print "Failed to delete" on any failure. This can be a misleading message, since we actually _did_ delete at the remote side, but we failed to delete locally. Rather than make the message more precise, let's just eliminate it entirely; the delete_ref routine already takes care of printing out a much more specific message about what went wrong. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- t/t5404-tracking-branches.sh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 't') diff --git a/t/t5404-tracking-branches.sh b/t/t5404-tracking-branches.sh index 1493a92c06..64fe2615ac 100755 --- a/t/t5404-tracking-branches.sh +++ b/t/t5404-tracking-branches.sh @@ -10,6 +10,7 @@ test_expect_success 'setup' ' git commit -m 1 && git branch b1 && git branch b2 && + git branch b3 && git clone . aa && git checkout b1 && echo b1 >>file && @@ -50,4 +51,10 @@ test_expect_success 'deleted branches have their tracking branches removed' ' test "$(git rev-parse origin/b1)" = "origin/b1" ' +test_expect_success 'already deleted tracking branches ignored' ' + git branch -d -r origin/b3 && + git push origin :b3 >output 2>&1 && + ! grep error output +' + test_done -- cgit v1.2.1 From 1db4a75c8d18d8827ac710e87219b349558d9196 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Tue, 8 Jul 2008 04:46:06 +0000 Subject: Remove unnecessary pack-*.keep file after successful git-clone Once a clone is successful we no longer need to hold onto the .keep file created by the transport. Delete the file so we can later repack the complete repository. Signed-off-by: Shawn O. Pearce Signed-off-by: Junio C Hamano --- t/t5601-clone.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 't') diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh index b642fb260b..d785b3df78 100755 --- a/t/t5601-clone.sh +++ b/t/t5601-clone.sh @@ -17,14 +17,32 @@ test_expect_success setup ' ' -test_expect_success 'clone with excess parameters' ' +test_expect_success 'clone with excess parameters (1)' ' + rm -fr dst && + test_must_fail git clone -n src dst junk + +' + +test_expect_success 'clone with excess parameters (2)' ' + + rm -fr dst && test_must_fail git clone -n "file://$(pwd)/src" dst junk ' +test_expect_success 'clone does not keep pack' ' + + rm -fr dst && + git clone -n "file://$(pwd)/src" dst && + ! test -f dst/file && + ! (echo dst/.git/objects/pack/pack-* | grep "\.keep") + +' + test_expect_success 'clone checks out files' ' + rm -fr dst && git clone src dst && test -f dst/file -- cgit v1.2.1