Skip to content

Commit a5d07d0

Browse files
pcloudsgitster
authored andcommitted
read-tree: add --no-sparse-checkout to disable sparse checkout support
Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f1f523e commit a5d07d0

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Documentation/git-read-tree.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SYNOPSIS
1010
--------
1111
'git read-tree' [[-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>]
1212
[-u [--exclude-per-directory=<gitignore>] | -i]]
13-
[--index-output=<file>]
13+
[--index-output=<file>] [--no-sparse-checkout]
1414
<tree-ish1> [<tree-ish2> [<tree-ish3>]]
1515

1616

@@ -110,6 +110,10 @@ OPTIONS
110110
directories the index file and index output file are
111111
located in.
112112

113+
--no-sparse-checkout::
114+
Disable sparse checkout support even if `core.sparseCheckout`
115+
is true.
116+
113117
<tree-ish#>::
114118
The id of the tree object(s) to be read/merged.
115119

builtin-read-tree.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ static int list_tree(unsigned char *sha1)
3131
}
3232

3333
static const char * const read_tree_usage[] = {
34-
"git read-tree [[-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>] [-u [--exclude-per-directory=<gitignore>] | -i]] [--index-output=<file>] <tree-ish1> [<tree-ish2> [<tree-ish3>]]",
34+
"git read-tree [[-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>] [-u [--exclude-per-directory=<gitignore>] | -i]] [--no-sparse-checkout] [--index-output=<file>] <tree-ish1> [<tree-ish2> [<tree-ish3>]]",
3535
NULL
3636
};
3737

@@ -98,6 +98,8 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix)
9898
PARSE_OPT_NONEG, exclude_per_directory_cb },
9999
OPT_SET_INT('i', NULL, &opts.index_only,
100100
"don't check the working tree after merging", 1),
101+
OPT_SET_INT(0, "no-sparse-checkout", &opts.skip_sparse_checkout,
102+
"skip applying sparse checkout filter", 1),
101103
OPT_END()
102104
};
103105

0 commit comments

Comments
 (0)