git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthijs Kooijman <matthijs@stdin.nl>
To: Duy Nguyen <pclouds@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	Git Mailing List <git@vger.kernel.org>,
	Matthijs Kooijman <matthijs@stdin.nl>
Subject: [PATCH] Add testcase for needless objects during a shallow fetch
Date: Wed, 28 Aug 2013 18:02:02 +0200	[thread overview]
Message-ID: <1377705722-17053-1-git-send-email-matthijs@stdin.nl> (raw)
In-Reply-To: <20130828153638.GF10217@login.drsnuggles.stderr.nl>

This is a testcase that checks for a problem where, during a specific
shallow fetch where the client does not have any commits that are a
successor of the new shallow root (i.e., the fetch creates a new
detached piece of history), the server would simply send over _all_
objects, instead of taking into account the objects already present in
the client.

The actual problem was fixed by a recent patch series by Nguyễn Thái
Ngọc Duy already.

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
---
 t/t5500-fetch-pack.sh | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
index fd2598e..a022d65 100755
--- a/t/t5500-fetch-pack.sh
+++ b/t/t5500-fetch-pack.sh
@@ -393,6 +393,17 @@ test_expect_success 'fetch in shallow repo unreachable shallow objects' '
 		git fsck --no-dangling
 	)
 '
+test_expect_success 'fetch creating new shallow root' '
+	(
+		git clone "file://$(pwd)/." shallow10 &&
+		git commit --allow-empty -m empty &&
+		cd shallow10 &&
+		git fetch --depth=1 --progress 2> actual &&
+		# This should fetch only the empty commit, no tree or
+		# blob objects
+		grep "remote: Total 1" actual
+	)
+'
 
 test_expect_success 'setup tests for the --stdin parameter' '
 	for head in C D E F
-- 
1.8.4.rc1

  reply	other threads:[~2013-08-28 16:31 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-11 22:01 [RFC PATCH] During a shallow fetch, prevent sending over unneeded objects Matthijs Kooijman
2013-07-11 22:53 ` Junio C Hamano
2013-07-12  7:11   ` Matthijs Kooijman
2013-08-07 10:27     ` Matthijs Kooijman
2013-08-08  1:01       ` Junio C Hamano
2013-08-08  1:09         ` Duy Nguyen
2013-08-08  6:39           ` Junio C Hamano
2013-08-08  4:50 ` Duy Nguyen
2013-08-08  6:51   ` Junio C Hamano
2013-08-08  7:21     ` Duy Nguyen
2013-08-08 17:10       ` Junio C Hamano
2013-08-09 13:13         ` Duy Nguyen
2013-08-12  8:02       ` Matthijs Kooijman
2013-08-16  9:51         ` Duy Nguyen
2013-08-16  9:52           ` [PATCH 1/6] Move setup_alternate_shallow and write_shallow_commits to shallow.c Nguyễn Thái Ngọc Duy
2013-08-16  9:52             ` [PATCH 2/6] shallow: only add shallow graft points to new shallow file Nguyễn Thái Ngọc Duy
2013-08-16 23:50               ` Eric Sunshine
2013-08-16  9:52             ` [PATCH 3/6] shallow: add setup_temporary_shallow() Nguyễn Thái Ngọc Duy
2013-08-16 23:52               ` Eric Sunshine
2013-08-16  9:52             ` [PATCH 4/6] upload-pack: delegate rev walking in shallow fetch to pack-objects Nguyễn Thái Ngọc Duy
2013-08-28 14:52               ` Matthijs Kooijman
2013-08-29  9:48                 ` Duy Nguyen
2013-08-16  9:52             ` [PATCH 5/6] list-objects: reduce one argument in mark_edges_uninteresting Nguyễn Thái Ngọc Duy
2013-08-16  9:52             ` [PATCH 6/6] list-objects: mark more commits as edges " Nguyễn Thái Ngọc Duy
2013-08-28 15:36           ` [RFC PATCH] During a shallow fetch, prevent sending over unneeded objects Matthijs Kooijman
2013-08-28 16:02             ` Matthijs Kooijman [this message]
2013-08-29  9:50               ` [PATCH] Add testcase for needless objects during a shallow fetch Duy Nguyen
2013-08-31  1:25                 ` Duy Nguyen
2013-10-21  7:51           ` [RFC PATCH] During a shallow fetch, prevent sending over unneeded objects Matthijs Kooijman
2013-10-26 10:49             ` Duy Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1377705722-17053-1-git-send-email-matthijs@stdin.nl \
    --to=matthijs@stdin.nl \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pclouds@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).