All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [BUG] Add a test to check git-prune does not throw away revs hidden by a graft.
@ 2006-05-18 21:35 Yann Dirson
  2006-05-18 21:37 ` Linus Torvalds
  0 siblings, 1 reply; 16+ messages in thread
From: Yann Dirson @ 2006-05-18 21:35 UTC (permalink / raw)
  To: junkio; +Cc: git


This test fails with 1.3.x and HEAD.  This is a very serious bug, since it
causes data loss.

I am not sure whether it is normal that git-fsck-objects does not retun an
error code, while we can see it reports the inconsistency in --verbose
mode.  At least trying to directly access the dropped commit triggers an
error anyway.

Signed-off-by: Yann Dirson <ydirson@altern.org>
---

 t/t6200-prune-grafts.sh |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/t/t6200-prune-grafts.sh b/t/t6200-prune-grafts.sh
new file mode 100755
index 0000000..80d0d59
--- /dev/null
+++ b/t/t6200-prune-grafts.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+#
+# Copyright (c) 2006 Yann Dirson
+#
+set -e
+
+test_description='Test that git-prune does not nuke revs hidden by a graft'
+
+. ./test-lib.sh
+
+echo First > A && git-add A && git-commit -m "Add A."
+echo First > B && git-add B && git-commit -m "Add B."
+echo Second >> A && git-update-index A && git-commit -m "Append to A."
+
+test_expect_success 'initial state is valid' 'git-fsck-objects'
+
+echo $(git-rev-parse HEAD) $(git-rev-parse HEAD^^) > .git/info/grafts
+
+test_expect_success 'grafted state is valid' 'git-fsck-objects'
+test_expect_success 'prune with the graft in effect' 'git-prune'
+test_expect_success 'grafted state is valid' 'git-fsck-objects'
+
+rm .git/info/grafts
+
+test_expect_success 'grafted state is still valid' 'git-fsck-objects'
+test_expect_success 'previously-hidden rev is still there' 'git-cat-file commit HEAD^'
+
+test_done

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2006-05-19 22:27 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-18 21:35 [PATCH] [BUG] Add a test to check git-prune does not throw away revs hidden by a graft Yann Dirson
2006-05-18 21:37 ` Linus Torvalds
2006-05-18 21:46   ` Junio C Hamano
2006-05-18 22:01     ` Linus Torvalds
2006-05-18 22:25       ` Junio C Hamano
2006-05-18 22:20     ` Yann Dirson
2006-05-18 22:36       ` Junio C Hamano
2006-05-18 22:52       ` Yann Dirson
2006-05-18 22:53         ` Junio C Hamano
2006-05-19 18:55           ` Yann Dirson
2006-05-19 19:00             ` Jakub Narebski
2006-05-19 19:02             ` Linus Torvalds
2006-05-19 20:25               ` Yann Dirson
2006-05-19 20:45                 ` Linus Torvalds
2006-05-19 22:22               ` Junio C Hamano
2006-05-19 22:26               ` [PATCH] [BUG] Add a test to check git-prune does not throw awayrevs " David Lang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.