Skip to content

Commit 1f3d9b9

Browse files
committed
Merge branch 'jt/index-pack-allow-promisor-only-while-fetching'
We now ensure "index-pack" is used with the "--promisor" option only during a "git fetch". * jt/index-pack-allow-promisor-only-while-fetching: index-pack: teach --promisor to forbid pack name
2 parents 8eaa065 + 1f2be8b commit 1f3d9b9

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

Documentation/git-index-pack.txt

+2
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ Also, if there are objects in the given pack that references non-promisor
144144
objects (in the repo), repacks those non-promisor objects into a promisor
145145
pack. This avoids a situation in which a repo has non-promisor objects that are
146146
accessible through promisor objects.
147+
+
148+
Requires <pack-file> to not be specified.
147149

148150
NOTES
149151
-----

builtin/index-pack.c

+2
Original file line numberDiff line numberDiff line change
@@ -1970,6 +1970,8 @@ int cmd_index_pack(int argc,
19701970
usage(index_pack_usage);
19711971
if (fix_thin_pack && !from_stdin)
19721972
die(_("the option '%s' requires '%s'"), "--fix-thin", "--stdin");
1973+
if (promisor_msg && pack_name)
1974+
die(_("--promisor cannot be used with a pack name"));
19731975
if (from_stdin && !startup_info->have_repository)
19741976
die(_("--stdin requires a git repository"));
19751977
if (from_stdin && hash_algo)

t/t5300-pack-object.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,8 @@ test_expect_success 'build pack index for an existing pack' '
332332
git index-pack -o tmp.idx test-3.pack &&
333333
cmp tmp.idx test-1-${packname_1}.idx &&
334334
335-
git index-pack --promisor=message test-3.pack &&
335+
git index-pack test-3.pack &&
336336
cmp test-3.idx test-1-${packname_1}.idx &&
337-
echo message >expect &&
338-
test_cmp expect test-3.promisor &&
339337
340338
cat test-2-${packname_2}.pack >test-3.pack &&
341339
git index-pack -o tmp.idx test-2-${packname_2}.pack &&

0 commit comments

Comments
 (0)