Skip to content

Commit 1ac83f4

Browse files
newrengitster
authored andcommitted
unpack-trees: rename ERROR_* fields meant for warnings to WARNING_*
We want to treat issues with setting the SKIP_WORKTREE bit as a warning rather than an error; rename the enum values to reflect this intent as a simple step towards that goal. Reviewed-by: Derrick Stolee <[email protected]> Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent cd002c1 commit 1ac83f4

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

unpack-trees.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ static const char *unpack_plumbing_errors[NB_UNPACK_TREES_ERROR_TYPES] = {
4646
/* ERROR_WOULD_LOSE_SUBMODULE */
4747
"Submodule '%s' cannot checkout new HEAD.",
4848

49-
/* ERROR_SPARSE_NOT_UPTODATE_FILE */
49+
/* WARNING_SPARSE_NOT_UPTODATE_FILE */
5050
"Entry '%s' not uptodate. Cannot update sparse checkout.",
5151

52-
/* ERROR_WOULD_LOSE_ORPHANED_OVERWRITTEN */
52+
/* WARNING_SPARSE_ORPHANED_NOT_OVERWRITTEN */
5353
"Working tree file '%s' would be overwritten by sparse checkout update.",
5454
};
5555

@@ -168,9 +168,9 @@ void setup_unpack_trees_porcelain(struct unpack_trees_options *opts,
168168
msgs[ERROR_WOULD_LOSE_SUBMODULE] =
169169
_("Cannot update submodule:\n%s");
170170

171-
msgs[ERROR_SPARSE_NOT_UPTODATE_FILE] =
171+
msgs[WARNING_SPARSE_NOT_UPTODATE_FILE] =
172172
_("Cannot update sparse checkout: the following entries are not up to date:\n%s");
173-
msgs[ERROR_WOULD_LOSE_ORPHANED_OVERWRITTEN] =
173+
msgs[WARNING_SPARSE_ORPHANED_NOT_OVERWRITTEN] =
174174
_("The following working tree files would be overwritten by sparse checkout update:\n%s");
175175

176176
opts->show_all_errors = 1;
@@ -509,7 +509,7 @@ static int apply_sparse_checkout(struct index_state *istate,
509509
ce->ce_flags &= ~CE_UPDATE;
510510
}
511511
if (was_skip_worktree && !ce_skip_worktree(ce)) {
512-
if (verify_absent_sparse(ce, ERROR_WOULD_LOSE_ORPHANED_OVERWRITTEN, o))
512+
if (verify_absent_sparse(ce, WARNING_SPARSE_ORPHANED_NOT_OVERWRITTEN, o))
513513
return -1;
514514
ce->ce_flags |= CE_UPDATE;
515515
}
@@ -1875,7 +1875,7 @@ int verify_uptodate(const struct cache_entry *ce,
18751875
static int verify_uptodate_sparse(const struct cache_entry *ce,
18761876
struct unpack_trees_options *o)
18771877
{
1878-
return verify_uptodate_1(ce, o, ERROR_SPARSE_NOT_UPTODATE_FILE);
1878+
return verify_uptodate_1(ce, o, WARNING_SPARSE_NOT_UPTODATE_FILE);
18791879
}
18801880

18811881
/*

unpack-trees.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ enum unpack_trees_error_types {
2323
ERROR_WOULD_LOSE_UNTRACKED_REMOVED,
2424
ERROR_BIND_OVERLAP,
2525
ERROR_WOULD_LOSE_SUBMODULE,
26-
ERROR_SPARSE_NOT_UPTODATE_FILE,
27-
ERROR_WOULD_LOSE_ORPHANED_OVERWRITTEN,
28-
NB_UNPACK_TREES_ERROR_TYPES
26+
27+
WARNING_SPARSE_NOT_UPTODATE_FILE,
28+
WARNING_SPARSE_ORPHANED_NOT_OVERWRITTEN,
29+
30+
NB_UNPACK_TREES_ERROR_TYPES,
2931
};
3032

3133
/*

0 commit comments

Comments
 (0)