@@ -112,19 +112,28 @@ test_expect_success 'setup master repo' '
112112 create_commits_in "$master_repo" A B C D E F G H I J K L M N O P Q R
113113'
114114
115+ test_expect_success ' master: pack-redundant works with no packfile' '
116+ (
117+ cd "$master_repo" &&
118+ cat >expect <<-EOF &&
119+ fatal: Zero packs found!
120+ EOF
121+ test_must_fail git pack-redundant --all >actual 2>&1 &&
122+ test_cmp expect actual
123+ )
124+ '
125+
115126# ############################################################################
116127# Chart of packs and objects for this test case
117128#
118129# | T A B C D E F G H I J K L M N O P Q R
119130# ----+--------------------------------------
120131# P1 | x x x x x x x x
121- # P2 | x x x x x x x
122- # P3 | x x x x x x
123132# ----+--------------------------------------
124- # ALL | x x x x x x x x x x x x x x x
133+ # ALL | x x x x x x x x
125134#
126135# ############################################################################
127- test_expect_success ' master: no redundant for pack 1, 2, 3 ' '
136+ test_expect_success ' master: pack- redundant works with one packfile ' '
128137 create_pack_in "$master_repo" P1 <<-EOF &&
129138 $T
130139 $A
@@ -135,6 +144,26 @@ test_expect_success 'master: no redundant for pack 1, 2, 3' '
135144 $F
136145 $R
137146 EOF
147+ (
148+ cd "$master_repo" &&
149+ git pack-redundant --all >out &&
150+ test_must_be_empty out
151+ )
152+ '
153+
154+ # ############################################################################
155+ # Chart of packs and objects for this test case
156+ #
157+ # | T A B C D E F G H I J K L M N O P Q R
158+ # ----+--------------------------------------
159+ # P1 | x x x x x x x x
160+ # P2 | x x x x x x x
161+ # P3 | x x x x x x
162+ # ----+--------------------------------------
163+ # ALL | x x x x x x x x x x x x x x x
164+ #
165+ # ############################################################################
166+ test_expect_success ' master: no redundant for pack 1, 2, 3' '
138167 create_pack_in "$master_repo" P2 <<-EOF &&
139168 $B
140169 $C
0 commit comments