Skip to content

Commit ca556f4

Browse files
KarthikNayakgitster
authored andcommitted
revision: rename bit to do_not_die_on_missing_objects
The bit `do_not_die_on_missing_tree` is used in revision.h to ensure the revision walker does not die when encountering a missing tree. This is currently exclusively set within `builtin/rev-list.c` to ensure the `--missing` option works with missing trees. In the upcoming commits, we will extend `--missing` to also support missing commits. So let's rename the bit to `do_not_die_on_missing_objects`, which is object type agnostic and can be used for both trees/commits. Signed-off-by: Karthik Nayak <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 922cc26 commit ca556f4

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

builtin/reflog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
298298
struct rev_info revs;
299299

300300
repo_init_revisions(the_repository, &revs, prefix);
301-
revs.do_not_die_on_missing_tree = 1;
301+
revs.do_not_die_on_missing_objects = 1;
302302
revs.ignore_missing = 1;
303303
revs.ignore_missing_links = 1;
304304
if (verbose)

builtin/rev-list.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
561561
}
562562

563563
if (arg_missing_action)
564-
revs.do_not_die_on_missing_tree = 1;
564+
revs.do_not_die_on_missing_objects = 1;
565565

566566
argc = setup_revisions(argc, argv, &revs, &s_r_opt);
567567

list-objects.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ static void process_tree(struct traversal_context *ctx,
177177
is_promisor_object(&obj->oid))
178178
return;
179179

180-
if (!revs->do_not_die_on_missing_tree)
180+
if (!revs->do_not_die_on_missing_objects)
181181
die("bad tree object %s", oid_to_hex(&obj->oid));
182182
}
183183

revision.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -212,18 +212,19 @@ struct rev_info {
212212

213213
/*
214214
* Blobs are shown without regard for their existence.
215-
* But not so for trees: unless exclude_promisor_objects
215+
* But not so for trees/commits: unless exclude_promisor_objects
216216
* is set and the tree in question is a promisor object;
217217
* OR ignore_missing_links is set, the revision walker
218-
* dies with a "bad tree object HASH" message when
219-
* encountering a missing tree. For callers that can
220-
* handle missing trees and want them to be filterable
218+
* dies with a "bad <type> object HASH" message when
219+
* encountering a missing object. For callers that can
220+
* handle missing trees/commits and want them to be filterable
221221
* and showable, set this to true. The revision walker
222-
* will filter and show such a missing tree as usual,
223-
* but will not attempt to recurse into this tree
224-
* object.
222+
* will filter and show such a missing object as usual,
223+
* but will not attempt to recurse into this tree/commit
224+
* object. The revision walker will also set the MISSING
225+
* flag for such objects.
225226
*/
226-
do_not_die_on_missing_tree:1,
227+
do_not_die_on_missing_objects:1,
227228

228229
/* for internal use only */
229230
exclude_promisor_objects:1;

0 commit comments

Comments
 (0)