Compare commits
49 Commits
v2.19.0-rc
...
v2.19.0-rc
Author | SHA1 | Date | |
---|---|---|---|
2f74393334 | |||
b9dfa238d5 | |||
8edb1b36b8 | |||
aa5dc61161 | |||
6201d755b9 | |||
926107db6d | |||
86ef236c98 | |||
99fb11d15b | |||
56ce87daff | |||
5f0ed3e204 | |||
1d27164f1a | |||
df19317f4f | |||
603160b17e | |||
1392c5d289 | |||
6d9276ea13 | |||
986c518107 | |||
fc0df933c8 | |||
6e96e88ae4 | |||
7ae96e3fcf | |||
a988ce9a58 | |||
d89db6f4c3 | |||
9b73732577 | |||
72f47be2db | |||
27c929edd6 | |||
d915114a3b | |||
7afb0d6777 | |||
183a638b7d | |||
2745817028 | |||
79b04f9b60 | |||
29d9e3e2c4 | |||
b89b4a660c | |||
c8b35b95e1 | |||
30612cb670 | |||
15da753709 | |||
1820703045 | |||
69d846f053 | |||
1c5e94f459 | |||
ec21ac8c18 | |||
f0dc593a95 | |||
ec10b018e7 | |||
bbc072f5d8 | |||
446e63ccf5 | |||
168f32eb10 | |||
eb90ea79c5 | |||
371979c217 | |||
ce528de023 | |||
9bf5d4c4e2 | |||
560ae1c164 | |||
9ac3f0e5b3 |
@ -83,6 +83,13 @@ UI, Workflows & Features
|
||||
* The sideband code learned to optionally paint selected keywords at
|
||||
the beginning of incoming lines on the receiving end.
|
||||
|
||||
* "git branch --list" learned to take the default sort order from the
|
||||
'branch.sort' configuration variable, just like "git tag --list"
|
||||
pays attention to 'tag.sort'.
|
||||
|
||||
* "git worktree" command learned "--quiet" option to make it less
|
||||
verbose.
|
||||
|
||||
|
||||
Performance, Internal Implementation, Development Support etc.
|
||||
|
||||
@ -251,6 +258,14 @@ Performance, Internal Implementation, Development Support etc.
|
||||
getting them coalesced into fewer packfiles, hurting performance.
|
||||
"git repack" now learned to repack them.
|
||||
|
||||
* Partially revert the support for multiple hash functions to regain
|
||||
hash comparison performance; we'd think of a way to do this better
|
||||
in the next cycle.
|
||||
|
||||
* "git help --config" (which is used in command line completion)
|
||||
missed the configuration variables not described in the main
|
||||
config.txt file but are described in another file that is included
|
||||
by it, which has been corrected.
|
||||
|
||||
Fixes since v2.18
|
||||
-----------------
|
||||
@ -300,7 +315,6 @@ Fixes since v2.18
|
||||
indicates whether/where a submodule repository has its associated
|
||||
working tree across various state transitions, which has been
|
||||
corrected.
|
||||
(merge 984cd77ddb sb/submodule-core-worktree later to maint).
|
||||
|
||||
* Bugfix for "rebase -i" corner case regression.
|
||||
(merge a9279c6785 pw/rebase-i-keep-reword-after-conflict later to maint).
|
||||
@ -533,6 +547,15 @@ Fixes since v2.18
|
||||
has been corrected.
|
||||
(merge 3e7dd99208 nd/cherry-pick-quit-fix later to maint).
|
||||
|
||||
* In a recent update in 2.18 era, "git pack-objects" started
|
||||
producing a larger than necessary packfiles by missing
|
||||
opportunities to use large deltas. This has been corrected.
|
||||
|
||||
* The meaning of the possible values the "core.checkStat"
|
||||
configuration variable can take were not adequately documented,
|
||||
which has been fixed.
|
||||
(merge 9bf5d4c4e2 nd/config-core-checkstat-doc later to maint).
|
||||
|
||||
* Code cleanup, docfix, build fix, etc.
|
||||
(merge aee9be2ebe sg/update-ref-stdin-cleanup later to maint).
|
||||
(merge 037714252f jc/clean-after-sanity-tests later to maint).
|
||||
@ -565,3 +588,13 @@ Fixes since v2.18
|
||||
(merge 10c600172c sg/t5310-empty-input-fix later to maint).
|
||||
(merge 5641eb9465 jh/partial-clone-doc later to maint).
|
||||
(merge 2711b1ad5e ab/submodule-relative-url-tests later to maint).
|
||||
(merge ce528de023 ab/unconditional-free-and-null later to maint).
|
||||
(merge bbc072f5d8 rs/opt-updates later to maint).
|
||||
(merge 69d846f053 jk/use-compat-util-in-test-tool later to maint).
|
||||
(merge 1820703045 js/larger-timestamps later to maint).
|
||||
(merge c8b35b95e1 sg/t4051-fix later to maint).
|
||||
(merge 30612cb670 sg/t0020-conversion-fix later to maint).
|
||||
(merge 15da753709 sg/t7501-thinkofix later to maint).
|
||||
(merge 79b04f9b60 sg/t3903-missing-fix later to maint).
|
||||
(merge 2745817028 sg/t3420-autostash-fix later to maint).
|
||||
(merge 7afb0d6777 sg/test-rebase-editor-fix later to maint).
|
||||
|
@ -462,10 +462,20 @@ core.untrackedCache::
|
||||
See linkgit:git-update-index[1]. `keep` by default.
|
||||
|
||||
core.checkStat::
|
||||
Determines which stat fields to match between the index
|
||||
and work tree. The user can set this to 'default' or
|
||||
'minimal'. Default (or explicitly 'default'), is to check
|
||||
all fields, including the sub-second part of mtime and ctime.
|
||||
When missing or is set to `default`, many fields in the stat
|
||||
structure are checked to detect if a file has been modified
|
||||
since Git looked at it. When this configuration variable is
|
||||
set to `minimal`, sub-second part of mtime and ctime, the
|
||||
uid and gid of the owner of the file, the inode number (and
|
||||
the device number, if Git was compiled to use it), are
|
||||
excluded from the check among these fields, leaving only the
|
||||
whole-second part of mtime (and ctime, if `core.trustCtime`
|
||||
is set) and the filesize to be checked.
|
||||
+
|
||||
There are implementations of Git that do not leave usable values in
|
||||
some fields (e.g. JGit); by excluding these fields from the
|
||||
comparison, the `minimal` mode may help interoperability when the
|
||||
same repository is used by these other systems at the same time.
|
||||
|
||||
core.quotePath::
|
||||
Commands that output paths (e.g. 'ls-files', 'diff'), will
|
||||
@ -917,12 +927,10 @@ core.notesRef::
|
||||
This setting defaults to "refs/notes/commits", and it can be overridden by
|
||||
the `GIT_NOTES_REF` environment variable. See linkgit:git-notes[1].
|
||||
|
||||
gc.commitGraph::
|
||||
If true, then gc will rewrite the commit-graph file when
|
||||
linkgit:git-gc[1] is run. When using linkgit:git-gc[1]
|
||||
'--auto' the commit-graph will be updated if housekeeping is
|
||||
required. Default is false. See linkgit:git-commit-graph[1]
|
||||
for details.
|
||||
core.commitGraph::
|
||||
If true, then git will read the commit-graph file (if it exists)
|
||||
to parse the graph structure of commits. Defaults to false. See
|
||||
linkgit:git-commit-graph[1] for more information.
|
||||
|
||||
core.useReplaceRefs::
|
||||
If set to `false`, behave as if the `--no-replace-objects`
|
||||
@ -1044,6 +1052,12 @@ branch.autoSetupRebase::
|
||||
branch to track another branch.
|
||||
This option defaults to never.
|
||||
|
||||
branch.sort::
|
||||
This variable controls the sort ordering of branches when displayed by
|
||||
linkgit:git-branch[1]. Without the "--sort=<value>" option provided, the
|
||||
value of this variable will be used as the default.
|
||||
See linkgit:git-for-each-ref[1] field names for valid values.
|
||||
|
||||
branch.<name>.remote::
|
||||
When on branch <name>, it tells 'git fetch' and 'git push'
|
||||
which remote to fetch from/push to. The remote to push to
|
||||
@ -1203,18 +1217,6 @@ This does not affect linkgit:git-format-patch[1] or the
|
||||
'git-diff-{asterisk}' plumbing commands. Can be overridden on the
|
||||
command line with the `--color[=<when>]` option.
|
||||
|
||||
diff.colorMoved::
|
||||
If set to either a valid `<mode>` or a true value, moved lines
|
||||
in a diff are colored differently, for details of valid modes
|
||||
see '--color-moved' in linkgit:git-diff[1]. If simply set to
|
||||
true the default color mode will be used. When set to false,
|
||||
moved lines are not colored.
|
||||
|
||||
diff.colorMovedWS::
|
||||
When moved lines are colored using e.g. the `diff.colorMoved` setting,
|
||||
this option controls the `<mode>` how spaces are treated
|
||||
for details of valid modes see '--color-moved-ws' in linkgit:git-diff[1].
|
||||
|
||||
color.diff.<slot>::
|
||||
Use customized color for diff colorization. `<slot>` specifies
|
||||
which part of the patch to use the specified color, and is one
|
||||
@ -1763,6 +1765,13 @@ this configuration variable is ignored, all packs except the base pack
|
||||
will be repacked. After this the number of packs should go below
|
||||
gc.autoPackLimit and gc.bigPackThreshold should be respected again.
|
||||
|
||||
gc.writeCommitGraph::
|
||||
If true, then gc will rewrite the commit-graph file when
|
||||
linkgit:git-gc[1] is run. When using linkgit:git-gc[1]
|
||||
'--auto' the commit-graph will be updated if housekeeping is
|
||||
required. Default is false. See linkgit:git-commit-graph[1]
|
||||
for details.
|
||||
|
||||
gc.logExpiry::
|
||||
If the file gc.log exists, then `git gc --auto` won't run
|
||||
unless that file is more than 'gc.logExpiry' old. Default is
|
||||
|
@ -208,3 +208,15 @@ diff.wsErrorHighlight::
|
||||
whitespace errors are colored with `color.diff.whitespace`.
|
||||
The command line option `--ws-error-highlight=<kind>`
|
||||
overrides this setting.
|
||||
|
||||
diff.colorMoved::
|
||||
If set to either a valid `<mode>` or a true value, moved lines
|
||||
in a diff are colored differently, for details of valid modes
|
||||
see '--color-moved' in linkgit:git-diff[1]. If simply set to
|
||||
true the default color mode will be used. When set to false,
|
||||
moved lines are not colored.
|
||||
|
||||
diff.colorMovedWS::
|
||||
When moved lines are colored using e.g. the `diff.colorMoved` setting,
|
||||
this option controls the `<mode>` how spaces are treated
|
||||
for details of valid modes see '--color-moved-ws' in linkgit:git-diff[1].
|
||||
|
@ -268,10 +268,11 @@ start-point is either a local or remote-tracking branch.
|
||||
order of the value. You may use the --sort=<key> option
|
||||
multiple times, in which case the last key becomes the primary
|
||||
key. The keys supported are the same as those in `git
|
||||
for-each-ref`. Sort order defaults to sorting based on the
|
||||
for-each-ref`. Sort order defaults to the value configured for the
|
||||
`branch.sort` variable if exists, or to sorting based on the
|
||||
full refname (including `refs/...` prefix). This lists
|
||||
detached HEAD (if present) first, then local branches and
|
||||
finally remote-tracking branches.
|
||||
finally remote-tracking branches. See linkgit:git-config[1].
|
||||
|
||||
|
||||
--points-at <object>::
|
||||
|
@ -173,6 +173,10 @@ This can also be set up as the default behaviour by using the
|
||||
This format will remain stable across Git versions and regardless of user
|
||||
configuration. See below for details.
|
||||
|
||||
-q::
|
||||
--quiet::
|
||||
With 'add', suppress feedback messages.
|
||||
|
||||
-v::
|
||||
--verbose::
|
||||
With `prune`, report all removals.
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
GVF=GIT-VERSION-FILE
|
||||
DEF_VER=v2.19.0-rc0
|
||||
DEF_VER=v2.19.0-rc1
|
||||
|
||||
LF='
|
||||
'
|
||||
|
2
Makefile
2
Makefile
@ -2047,7 +2047,7 @@ $(BUILT_INS): git$X
|
||||
|
||||
command-list.h: generate-cmdlist.sh command-list.txt
|
||||
|
||||
command-list.h: $(wildcard Documentation/git*.txt) Documentation/config.txt
|
||||
command-list.h: $(wildcard Documentation/git*.txt) Documentation/*config.txt
|
||||
$(QUIET_GEN)$(SHELL_PATH) ./generate-cmdlist.sh command-list.txt >$@+ && mv $@+ $@
|
||||
|
||||
SCRIPT_DEFINES = $(SHELL_PATH_SQ):$(DIFF_SQ):$(GIT_VERSION):\
|
||||
|
4
blame.c
4
blame.c
@ -337,9 +337,7 @@ static void fill_origin_blob(struct diff_options *opt,
|
||||
|
||||
static void drop_origin_blob(struct blame_origin *o)
|
||||
{
|
||||
if (o->file.ptr) {
|
||||
FREE_AND_NULL(o->file.ptr);
|
||||
}
|
||||
FREE_AND_NULL(o->file.ptr);
|
||||
}
|
||||
|
||||
/*
|
||||
|
4
branch.c
4
branch.c
@ -25,9 +25,7 @@ static int find_tracked_branch(struct remote *remote, void *priv)
|
||||
tracking->remote = remote->name;
|
||||
} else {
|
||||
free(tracking->spec.src);
|
||||
if (tracking->src) {
|
||||
FREE_AND_NULL(tracking->src);
|
||||
}
|
||||
FREE_AND_NULL(tracking->src);
|
||||
}
|
||||
tracking->spec.src = NULL;
|
||||
}
|
||||
|
@ -74,6 +74,14 @@ define_list_config_array(color_branch_slots);
|
||||
static int git_branch_config(const char *var, const char *value, void *cb)
|
||||
{
|
||||
const char *slot_name;
|
||||
struct ref_sorting **sorting_tail = (struct ref_sorting **)cb;
|
||||
|
||||
if (!strcmp(var, "branch.sort")) {
|
||||
if (!value)
|
||||
return config_error_nonbool(var);
|
||||
parse_ref_sorting(sorting_tail, value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (starts_with(var, "column."))
|
||||
return git_column_config(var, value, "branch", &colopts);
|
||||
@ -653,7 +661,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
|
||||
if (argc == 2 && !strcmp(argv[1], "-h"))
|
||||
usage_with_options(builtin_branch_usage, options);
|
||||
|
||||
git_config(git_branch_config, NULL);
|
||||
git_config(git_branch_config, sorting_tail);
|
||||
|
||||
track = git_branch_track;
|
||||
|
||||
|
@ -172,7 +172,7 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix)
|
||||
N_("write the content to temporary files")),
|
||||
OPT_STRING(0, "prefix", &state.base_dir, N_("string"),
|
||||
N_("when creating files, prepend <string>")),
|
||||
{ OPTION_CALLBACK, 0, "stage", NULL, "1-3|all",
|
||||
{ OPTION_CALLBACK, 0, "stage", NULL, "(1|2|3|all)",
|
||||
N_("copy out the files from named stage"),
|
||||
PARSE_OPT_NONEG, option_parse_stage },
|
||||
OPT_END()
|
||||
|
@ -2041,10 +2041,6 @@ static int try_delta(struct unpacked *trg, struct unpacked *src,
|
||||
delta_buf = create_delta(src->index, trg->data, trg_size, &delta_size, max_size);
|
||||
if (!delta_buf)
|
||||
return 0;
|
||||
if (delta_size >= (1U << OE_DELTA_SIZE_BITS)) {
|
||||
free(delta_buf);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (DELTA(trg_entry)) {
|
||||
/* Prefer only shallower same-sized deltas. */
|
||||
@ -2303,6 +2299,7 @@ static void init_threaded_search(void)
|
||||
pthread_mutex_init(&cache_mutex, NULL);
|
||||
pthread_mutex_init(&progress_mutex, NULL);
|
||||
pthread_cond_init(&progress_cond, NULL);
|
||||
pthread_mutex_init(&to_pack.lock, NULL);
|
||||
old_try_to_free_routine = set_try_to_free_routine(try_to_free_from_threads);
|
||||
}
|
||||
|
||||
|
@ -135,7 +135,7 @@ static struct option pull_options[] = {
|
||||
/* Options passed to git-merge or git-rebase */
|
||||
OPT_GROUP(N_("Options related to merging")),
|
||||
{ OPTION_CALLBACK, 'r', "rebase", &opt_rebase,
|
||||
"false|true|merges|preserve|interactive",
|
||||
"(false|true|merges|preserve|interactive)",
|
||||
N_("incorporate changes by rebasing rather than merging"),
|
||||
PARSE_OPT_OPTARG, parse_opt_rebase },
|
||||
OPT_PASSTHRU('n', NULL, &opt_diffstat, NULL,
|
||||
|
@ -561,7 +561,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)
|
||||
0, CAS_OPT_NAME, &cas, N_("<refname>:<expect>"),
|
||||
N_("require old value of ref to be at this value"),
|
||||
PARSE_OPT_OPTARG | PARSE_OPT_LITERAL_ARGHELP, parseopt_push_cas_option },
|
||||
{ OPTION_CALLBACK, 0, "recurse-submodules", &recurse_submodules, "check|on-demand|no",
|
||||
{ OPTION_CALLBACK, 0, "recurse-submodules", &recurse_submodules, "(check|on-demand|no)",
|
||||
N_("control recursive pushing of submodules"),
|
||||
PARSE_OPT_OPTARG, option_parse_recurse_submodules },
|
||||
OPT_BOOL_F( 0 , "thin", &thin, N_("use thin pack"), PARSE_OPT_NOCOMPLETE),
|
||||
@ -576,7 +576,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)
|
||||
OPT_BIT(0, "follow-tags", &flags, N_("push missing but relevant tags"),
|
||||
TRANSPORT_PUSH_FOLLOW_TAGS),
|
||||
{ OPTION_CALLBACK,
|
||||
0, "signed", &push_cert, "yes|no|if-asked", N_("GPG sign the push"),
|
||||
0, "signed", &push_cert, "(yes|no|if-asked)", N_("GPG sign the push"),
|
||||
PARSE_OPT_OPTARG, option_parse_push_signed },
|
||||
OPT_BIT(0, "atomic", &flags, N_("request atomic transaction on remote side"), TRANSPORT_PUSH_ATOMIC),
|
||||
OPT_STRING_LIST('o', "push-option", &push_options_cmdline, N_("server-specific"), N_("option to transmit")),
|
||||
|
@ -25,7 +25,7 @@ int cmd_range_diff(int argc, const char **argv, const char *prefix)
|
||||
OPT_INTEGER(0, "creation-factor", &creation_factor,
|
||||
N_("Percentage by which creation is weighted")),
|
||||
OPT_BOOL(0, "no-dual-color", &simple_color,
|
||||
N_("color both diff and diff-between-diffs")),
|
||||
N_("use simple diff colors")),
|
||||
OPT_END()
|
||||
};
|
||||
int i, j, res = 0;
|
||||
|
@ -168,7 +168,7 @@ static int add(int argc, const char **argv)
|
||||
OPT_STRING_LIST('t', "track", &track, N_("branch"),
|
||||
N_("branch(es) to track")),
|
||||
OPT_STRING('m', "master", &master, N_("branch"), N_("master branch")),
|
||||
{ OPTION_CALLBACK, 0, "mirror", &mirror, N_("push|fetch"),
|
||||
{ OPTION_CALLBACK, 0, "mirror", &mirror, "(push|fetch)",
|
||||
N_("set up remote as a mirror to push to or fetch from"),
|
||||
PARSE_OPT_OPTARG | PARSE_OPT_COMP_ARG, parse_mirror_opt },
|
||||
OPT_END()
|
||||
|
@ -166,7 +166,7 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)
|
||||
OPT_BOOL(0, "mirror", &send_mirror, N_("mirror all refs")),
|
||||
OPT_BOOL('f', "force", &force_update, N_("force updates")),
|
||||
{ OPTION_CALLBACK,
|
||||
0, "signed", &push_cert, "yes|no|if-asked", N_("GPG sign the push"),
|
||||
0, "signed", &push_cert, "(yes|no|if-asked)", N_("GPG sign the push"),
|
||||
PARSE_OPT_OPTARG, option_parse_push_signed },
|
||||
OPT_STRING_LIST(0, "push-option", &push_options,
|
||||
N_("server-specific"),
|
||||
|
@ -542,7 +542,7 @@ static void runcommand_in_submodule_cb(const struct cache_entry *list_item,
|
||||
argv_array_pushv(&cpr.args, info->argv);
|
||||
|
||||
if (run_command(&cpr))
|
||||
die(_("run_command returned non-zero status while"
|
||||
die(_("run_command returned non-zero status while "
|
||||
"recursing in the nested submodules of %s\n."),
|
||||
displaypath);
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ static const char * const worktree_usage[] = {
|
||||
struct add_opts {
|
||||
int force;
|
||||
int detach;
|
||||
int quiet;
|
||||
int checkout;
|
||||
int keep_locked;
|
||||
};
|
||||
@ -303,9 +304,13 @@ static int add_worktree(const char *path, const char *refname,
|
||||
if (!is_branch)
|
||||
argv_array_pushl(&cp.args, "update-ref", "HEAD",
|
||||
oid_to_hex(&commit->object.oid), NULL);
|
||||
else
|
||||
else {
|
||||
argv_array_pushl(&cp.args, "symbolic-ref", "HEAD",
|
||||
symref.buf, NULL);
|
||||
if (opts->quiet)
|
||||
argv_array_push(&cp.args, "--quiet");
|
||||
}
|
||||
|
||||
cp.env = child_env.argv;
|
||||
ret = run_command(&cp);
|
||||
if (ret)
|
||||
@ -315,6 +320,8 @@ static int add_worktree(const char *path, const char *refname,
|
||||
cp.argv = NULL;
|
||||
argv_array_clear(&cp.args);
|
||||
argv_array_pushl(&cp.args, "reset", "--hard", NULL);
|
||||
if (opts->quiet)
|
||||
argv_array_push(&cp.args, "--quiet");
|
||||
cp.env = child_env.argv;
|
||||
ret = run_command(&cp);
|
||||
if (ret)
|
||||
@ -437,6 +444,7 @@ static int add(int ac, const char **av, const char *prefix)
|
||||
OPT_BOOL(0, "detach", &opts.detach, N_("detach HEAD at named commit")),
|
||||
OPT_BOOL(0, "checkout", &opts.checkout, N_("populate the new working tree")),
|
||||
OPT_BOOL(0, "lock", &opts.keep_locked, N_("keep the new working tree locked")),
|
||||
OPT__QUIET(&opts.quiet, N_("suppress progress reporting")),
|
||||
OPT_PASSTHRU(0, "track", &opt_track, NULL,
|
||||
N_("set up tracking mode (see git-branch(1))"),
|
||||
PARSE_OPT_NOARG | PARSE_OPT_OPTARG),
|
||||
@ -491,8 +499,8 @@ static int add(int ac, const char **av, const char *prefix)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print_preparing_worktree_line(opts.detach, branch, new_branch, !!new_branch_force);
|
||||
if (!opts.quiet)
|
||||
print_preparing_worktree_line(opts.detach, branch, new_branch, !!new_branch_force);
|
||||
|
||||
if (new_branch) {
|
||||
struct child_process cp = CHILD_PROCESS_INIT;
|
||||
@ -500,6 +508,8 @@ static int add(int ac, const char **av, const char *prefix)
|
||||
argv_array_push(&cp.args, "branch");
|
||||
if (new_branch_force)
|
||||
argv_array_push(&cp.args, "--force");
|
||||
if (opts.quiet)
|
||||
argv_array_push(&cp.args, "--quiet");
|
||||
argv_array_push(&cp.args, new_branch);
|
||||
argv_array_push(&cp.args, branch);
|
||||
if (opt_track)
|
||||
|
10
cache.h
10
cache.h
@ -1023,6 +1023,16 @@ extern const struct object_id null_oid;
|
||||
|
||||
static inline int hashcmp(const unsigned char *sha1, const unsigned char *sha2)
|
||||
{
|
||||
/*
|
||||
* This is a temporary optimization hack. By asserting the size here,
|
||||
* we let the compiler know that it's always going to be 20, which lets
|
||||
* it turn this fixed-size memcmp into a few inline instructions.
|
||||
*
|
||||
* This will need to be extended or ripped out when we learn about
|
||||
* hashes of different sizes.
|
||||
*/
|
||||
if (the_hash_algo->rawsz != 20)
|
||||
BUG("hash size not yet supported by hashcmp");
|
||||
return memcmp(sha1, sha2, the_hash_algo->rawsz);
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,7 @@ then
|
||||
export GIT_TEST_SPLIT_INDEX=yes
|
||||
export GIT_TEST_FULL_IN_PACK_ARRAY=true
|
||||
export GIT_TEST_OE_SIZE=10
|
||||
export GIT_TEST_OE_DELTA_SIZE=5
|
||||
make --quiet test
|
||||
fi
|
||||
|
||||
|
2
commit.c
2
commit.c
@ -656,7 +656,7 @@ struct commit *pop_commit(struct commit_list **stack)
|
||||
define_commit_slab(indegree_slab, int);
|
||||
|
||||
/* record author-date for each commit object */
|
||||
define_commit_slab(author_date_slab, unsigned long);
|
||||
define_commit_slab(author_date_slab, timestamp_t);
|
||||
|
||||
static void record_author_date(struct author_date_slab *author_date,
|
||||
struct commit *commit)
|
||||
|
2
config.c
2
config.c
@ -124,7 +124,7 @@ static const char include_depth_advice[] = N_(
|
||||
" %s\n"
|
||||
"from\n"
|
||||
" %s\n"
|
||||
"Do you have circular includes?");
|
||||
"This might be due to circular includes.");
|
||||
static int handle_path_include(const char *path, struct config_include_data *inc)
|
||||
{
|
||||
int ret = 0;
|
||||
|
@ -80,7 +80,7 @@ print_config_list () {
|
||||
cat <<EOF
|
||||
static const char *config_name_list[] = {
|
||||
EOF
|
||||
grep '^[a-zA-Z].*\..*::$' Documentation/config.txt |
|
||||
grep -h '^[a-zA-Z].*\..*::$' Documentation/*config.txt |
|
||||
sed '/deprecated/d; s/::$//; s/, */\n/g' |
|
||||
sort |
|
||||
while read line
|
||||
|
4
http.c
4
http.c
@ -2418,9 +2418,7 @@ void release_http_object_request(struct http_object_request *freq)
|
||||
close(freq->localfile);
|
||||
freq->localfile = -1;
|
||||
}
|
||||
if (freq->url != NULL) {
|
||||
FREE_AND_NULL(freq->url);
|
||||
}
|
||||
FREE_AND_NULL(freq->url);
|
||||
if (freq->slot != NULL) {
|
||||
freq->slot->callback_func = NULL;
|
||||
freq->slot->callback_data = NULL;
|
||||
|
@ -146,6 +146,8 @@ void prepare_packing_data(struct packing_data *pdata)
|
||||
|
||||
pdata->oe_size_limit = git_env_ulong("GIT_TEST_OE_SIZE",
|
||||
1U << OE_SIZE_BITS);
|
||||
pdata->oe_delta_size_limit = git_env_ulong("GIT_TEST_OE_DELTA_SIZE",
|
||||
1UL << OE_DELTA_SIZE_BITS);
|
||||
}
|
||||
|
||||
struct object_entry *packlist_alloc(struct packing_data *pdata,
|
||||
@ -160,6 +162,8 @@ struct object_entry *packlist_alloc(struct packing_data *pdata,
|
||||
|
||||
if (!pdata->in_pack_by_idx)
|
||||
REALLOC_ARRAY(pdata->in_pack, pdata->nr_alloc);
|
||||
if (pdata->delta_size)
|
||||
REALLOC_ARRAY(pdata->delta_size, pdata->nr_alloc);
|
||||
}
|
||||
|
||||
new_entry = pdata->objects + pdata->nr_objects++;
|
||||
|
@ -2,6 +2,7 @@
|
||||
#define PACK_OBJECTS_H
|
||||
|
||||
#include "object-store.h"
|
||||
#include "thread-utils.h"
|
||||
#include "pack.h"
|
||||
|
||||
#define DEFAULT_DELTA_CACHE_SIZE (256 * 1024 * 1024)
|
||||
@ -15,7 +16,7 @@
|
||||
* above this limit. Don't lower it too much.
|
||||
*/
|
||||
#define OE_SIZE_BITS 31
|
||||
#define OE_DELTA_SIZE_BITS 20
|
||||
#define OE_DELTA_SIZE_BITS 23
|
||||
|
||||
/*
|
||||
* State flags for depth-first search used for analyzing delta cycles.
|
||||
@ -95,11 +96,12 @@ struct object_entry {
|
||||
*/
|
||||
unsigned delta_size_:OE_DELTA_SIZE_BITS; /* delta data size (uncompressed) */
|
||||
unsigned delta_size_valid:1;
|
||||
unsigned char in_pack_header_size;
|
||||
unsigned in_pack_idx:OE_IN_PACK_BITS; /* already in pack */
|
||||
unsigned z_delta_size:OE_Z_DELTA_BITS;
|
||||
unsigned type_valid:1;
|
||||
unsigned type_:TYPE_BITS;
|
||||
unsigned no_try_delta:1;
|
||||
unsigned type_:TYPE_BITS;
|
||||
unsigned in_pack_type:TYPE_BITS; /* could be delta */
|
||||
unsigned preferred_base:1; /*
|
||||
* we do not pack this, but is available
|
||||
@ -109,17 +111,16 @@ struct object_entry {
|
||||
unsigned tagged:1; /* near the very tip of refs */
|
||||
unsigned filled:1; /* assigned write-order */
|
||||
unsigned dfs_state:OE_DFS_STATE_BITS;
|
||||
unsigned char in_pack_header_size;
|
||||
unsigned depth:OE_DEPTH_BITS;
|
||||
|
||||
/*
|
||||
* pahole results on 64-bit linux (gcc and clang)
|
||||
*
|
||||
* size: 80, bit_padding: 20 bits, holes: 8 bits
|
||||
* size: 80, bit_padding: 9 bits
|
||||
*
|
||||
* and on 32-bit (gcc)
|
||||
*
|
||||
* size: 76, bit_padding: 20 bits, holes: 8 bits
|
||||
* size: 76, bit_padding: 9 bits
|
||||
*/
|
||||
};
|
||||
|
||||
@ -131,6 +132,7 @@ struct packing_data {
|
||||
uint32_t index_size;
|
||||
|
||||
unsigned int *in_pack_pos;
|
||||
unsigned long *delta_size;
|
||||
|
||||
/*
|
||||
* Only one of these can be non-NULL and they have different
|
||||
@ -141,10 +143,29 @@ struct packing_data {
|
||||
struct packed_git **in_pack_by_idx;
|
||||
struct packed_git **in_pack;
|
||||
|
||||
#ifndef NO_PTHREADS
|
||||
pthread_mutex_t lock;
|
||||
#endif
|
||||
|
||||
uintmax_t oe_size_limit;
|
||||
uintmax_t oe_delta_size_limit;
|
||||
};
|
||||
|
||||
void prepare_packing_data(struct packing_data *pdata);
|
||||
|
||||
static inline void packing_data_lock(struct packing_data *pdata)
|
||||
{
|
||||
#ifndef NO_PTHREADS
|
||||
pthread_mutex_lock(&pdata->lock);
|
||||
#endif
|
||||
}
|
||||
static inline void packing_data_unlock(struct packing_data *pdata)
|
||||
{
|
||||
#ifndef NO_PTHREADS
|
||||
pthread_mutex_unlock(&pdata->lock);
|
||||
#endif
|
||||
}
|
||||
|
||||
struct object_entry *packlist_alloc(struct packing_data *pdata,
|
||||
const unsigned char *sha1,
|
||||
uint32_t index_pos);
|
||||
@ -333,18 +354,34 @@ static inline unsigned long oe_delta_size(struct packing_data *pack,
|
||||
{
|
||||
if (e->delta_size_valid)
|
||||
return e->delta_size_;
|
||||
return oe_size(pack, e);
|
||||
|
||||
/*
|
||||
* pack->detla_size[] can't be NULL because oe_set_delta_size()
|
||||
* must have been called when a new delta is saved with
|
||||
* oe_set_delta().
|
||||
* If oe_delta() returns NULL (i.e. default state, which means
|
||||
* delta_size_valid is also false), then the caller must never
|
||||
* call oe_delta_size().
|
||||
*/
|
||||
return pack->delta_size[e - pack->objects];
|
||||
}
|
||||
|
||||
static inline void oe_set_delta_size(struct packing_data *pack,
|
||||
struct object_entry *e,
|
||||
unsigned long size)
|
||||
{
|
||||
e->delta_size_ = size;
|
||||
e->delta_size_valid = e->delta_size_ == size;
|
||||
if (!e->delta_size_valid && size != oe_size(pack, e))
|
||||
BUG("this can only happen in check_object() "
|
||||
"where delta size is the same as entry size");
|
||||
if (size < pack->oe_delta_size_limit) {
|
||||
e->delta_size_ = size;
|
||||
e->delta_size_valid = 1;
|
||||
} else {
|
||||
packing_data_lock(pack);
|
||||
if (!pack->delta_size)
|
||||
ALLOC_ARRAY(pack->delta_size, pack->nr_alloc);
|
||||
packing_data_unlock(pack);
|
||||
|
||||
pack->delta_size[e - pack->objects] = size;
|
||||
e->delta_size_valid = 0;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -720,7 +720,7 @@ static const char *read_author_ident(struct strbuf *buf)
|
||||
/* dequote values and construct ident line in-place */
|
||||
for (in = buf->buf; i < 3 && in - buf->buf < buf->len; i++) {
|
||||
if (!skip_prefix(in, keys[i], (const char **)&in)) {
|
||||
warning(_("could not parse '%s' (looking for '%s'"),
|
||||
warning(_("could not parse '%s' (looking for '%s')"),
|
||||
rebase_path_author_script(), keys[i]);
|
||||
return NULL;
|
||||
}
|
||||
|
4
t/README
4
t/README
@ -315,6 +315,10 @@ packs on demand. This normally only happens when the object size is
|
||||
over 2GB. This variable forces the code path on any object larger than
|
||||
<n> bytes.
|
||||
|
||||
GIT_TEST_OE_DELTA_SIZE=<n> exercises the uncomon pack-objects code
|
||||
path where deltas larger than this limit require extra memory
|
||||
allocation for bookkeeping.
|
||||
|
||||
Naming Tests
|
||||
------------
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
#ifndef __TEST_TOOL_H__
|
||||
#define __TEST_TOOL_H__
|
||||
|
||||
#include "git-compat-util.h"
|
||||
|
||||
int cmd__chmtime(int argc, const char **argv);
|
||||
int cmd__config(int argc, const char **argv);
|
||||
int cmd__ctype(int argc, const char **argv);
|
||||
|
@ -14,8 +14,8 @@
|
||||
# specified line.
|
||||
#
|
||||
# "<cmd> <lineno>" -- add a line with the specified command
|
||||
# ("squash", "fixup", "edit", "reword" or "drop") and the SHA1 taken
|
||||
# from the specified line.
|
||||
# ("pick", "squash", "fixup", "edit", "reword" or "drop") and the
|
||||
# SHA1 taken from the specified line.
|
||||
#
|
||||
# "exec_cmd_with_args" -- add an "exec cmd with args" line.
|
||||
#
|
||||
@ -47,7 +47,7 @@ set_fake_editor () {
|
||||
action=pick
|
||||
for line in $FAKE_LINES; do
|
||||
case $line in
|
||||
squash|fixup|edit|reword|drop)
|
||||
pick|squash|fixup|edit|reword|drop)
|
||||
action="$line";;
|
||||
exec*)
|
||||
echo "$line" | sed 's/_/ /g' >> "$1";;
|
||||
|
@ -116,7 +116,7 @@ check_sub_test_lib_test () {
|
||||
name="$1" # stdin is the expected output from the test
|
||||
(
|
||||
cd "$name" &&
|
||||
! test -s err &&
|
||||
test_must_be_empty err &&
|
||||
sed -e 's/^> //' -e 's/Z$//' >expect &&
|
||||
test_cmp expect out
|
||||
)
|
||||
|
@ -167,9 +167,8 @@ test_expect_success 'reinit' '
|
||||
) &&
|
||||
test_i18ngrep "Initialized empty" again/out1 &&
|
||||
test_i18ngrep "Reinitialized existing" again/out2 &&
|
||||
>again/empty &&
|
||||
test_i18ncmp again/empty again/err1 &&
|
||||
test_i18ncmp again/empty again/err2
|
||||
test_must_be_empty again/err1 &&
|
||||
test_must_be_empty again/err2
|
||||
'
|
||||
|
||||
test_expect_success 'init with --template' '
|
||||
|
@ -208,9 +208,8 @@ test_expect_success 'attribute test: --all option' '
|
||||
'
|
||||
|
||||
test_expect_success 'attribute test: --cached option' '
|
||||
: >empty &&
|
||||
git check-attr --cached --stdin --all <stdin-all | sort >actual &&
|
||||
test_cmp empty actual &&
|
||||
test_must_be_empty actual &&
|
||||
git add .gitattributes a/.gitattributes a/b/.gitattributes &&
|
||||
git check-attr --cached --stdin --all <stdin-all | sort >actual &&
|
||||
test_cmp specified-all actual
|
||||
|
@ -160,7 +160,7 @@ test_expect_success 'checkout with autocrlf=input' '
|
||||
git config core.autocrlf input &&
|
||||
git read-tree --reset -u HEAD &&
|
||||
test_must_fail has_cr one &&
|
||||
test_must_fail has_cr two &&
|
||||
test_must_fail has_cr dir/two &&
|
||||
git update-index -- one dir/two &&
|
||||
test "$one" = $(git hash-object --stdin <one) &&
|
||||
test "$two" = $(git hash-object --stdin <dir/two) &&
|
||||
|
@ -320,22 +320,20 @@ test_expect_success \
|
||||
|
||||
test_expect_success \
|
||||
'spaces with newline at end should be replaced with empty string' '
|
||||
printf "" >expect &&
|
||||
|
||||
echo | git stripspace >actual &&
|
||||
test_cmp expect actual &&
|
||||
test_must_be_empty actual &&
|
||||
|
||||
echo "$sss" | git stripspace >actual &&
|
||||
test_cmp expect actual &&
|
||||
test_must_be_empty actual &&
|
||||
|
||||
echo "$sss$sss" | git stripspace >actual &&
|
||||
test_cmp expect actual &&
|
||||
test_must_be_empty actual &&
|
||||
|
||||
echo "$sss$sss$sss" | git stripspace >actual &&
|
||||
test_cmp expect actual &&
|
||||
test_must_be_empty actual &&
|
||||
|
||||
echo "$sss$sss$sss$sss" | git stripspace >actual &&
|
||||
test_cmp expect actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success \
|
||||
@ -349,19 +347,17 @@ test_expect_success \
|
||||
|
||||
test_expect_success \
|
||||
'spaces without newline at end should be replaced with empty string' '
|
||||
printf "" >expect &&
|
||||
|
||||
printf "" | git stripspace >actual &&
|
||||
test_cmp expect actual &&
|
||||
test_must_be_empty actual &&
|
||||
|
||||
printf "$sss$sss" | git stripspace >actual &&
|
||||
test_cmp expect actual &&
|
||||
test_must_be_empty actual &&
|
||||
|
||||
printf "$sss$sss$sss" | git stripspace >actual &&
|
||||
test_cmp expect actual &&
|
||||
test_must_be_empty actual &&
|
||||
|
||||
printf "$sss$sss$sss$sss" | git stripspace >actual &&
|
||||
test_cmp expect actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success \
|
||||
|
@ -286,11 +286,9 @@ test_expect_success 'OPT_CALLBACK() and OPT_BIT() work' '
|
||||
test_cmp expect output
|
||||
'
|
||||
|
||||
>expect
|
||||
|
||||
test_expect_success 'OPT_CALLBACK() and callback errors work' '
|
||||
test_must_fail test-parse-options --no-length >output 2>output.err &&
|
||||
test_i18ncmp expect output &&
|
||||
test_must_be_empty output &&
|
||||
test_must_be_empty output.err
|
||||
'
|
||||
|
||||
|
@ -11,7 +11,6 @@ cat >hello-script <<-EOF
|
||||
#!$SHELL_PATH
|
||||
cat hello-script
|
||||
EOF
|
||||
>empty
|
||||
|
||||
test_expect_success 'start_command reports ENOENT' '
|
||||
test-tool run-command start-command-ENOENT ./does-not-exist
|
||||
@ -23,7 +22,7 @@ test_expect_success 'run_command can run a command' '
|
||||
test-tool run-command run-command ./hello.sh >actual 2>err &&
|
||||
|
||||
test_cmp hello-script actual &&
|
||||
test_cmp empty err
|
||||
test_must_be_empty err
|
||||
'
|
||||
|
||||
test_expect_success !MINGW 'run_command can run a script without a #! line' '
|
||||
@ -34,7 +33,7 @@ test_expect_success !MINGW 'run_command can run a script without a #! line' '
|
||||
test-tool run-command run-command ./hello >actual 2>err &&
|
||||
|
||||
test_cmp hello-script actual &&
|
||||
test_cmp empty err
|
||||
test_must_be_empty err
|
||||
'
|
||||
|
||||
test_expect_success 'run_command does not try to execute a directory' '
|
||||
@ -47,7 +46,7 @@ test_expect_success 'run_command does not try to execute a directory' '
|
||||
PATH=$PWD/bin1:$PWD/bin2:$PATH \
|
||||
test-tool run-command run-command greet >actual 2>err &&
|
||||
test_cmp bin2/greet actual &&
|
||||
test_cmp empty err
|
||||
test_must_be_empty err
|
||||
'
|
||||
|
||||
test_expect_success POSIXPERM 'run_command passes over non-executable file' '
|
||||
@ -64,7 +63,7 @@ test_expect_success POSIXPERM 'run_command passes over non-executable file' '
|
||||
PATH=$PWD/bin1:$PWD/bin2:$PATH \
|
||||
test-tool run-command run-command greet >actual 2>err &&
|
||||
test_cmp bin2/greet actual &&
|
||||
test_cmp empty err
|
||||
test_must_be_empty err
|
||||
'
|
||||
|
||||
test_expect_success POSIXPERM 'run_command reports EACCES' '
|
||||
|
@ -239,7 +239,7 @@ test_expect_success 'no phantom error when switching trees' '
|
||||
>newdir/one &&
|
||||
git add newdir/one &&
|
||||
git checkout 2>errors &&
|
||||
! test -s errors
|
||||
test_must_be_empty errors
|
||||
'
|
||||
|
||||
test_expect_success 'switching trees does not invalidate shared index' '
|
||||
|
@ -11,7 +11,7 @@ test_expect_success 'git show a ISO-8859-1 commit under C locale' '
|
||||
. "$TEST_DIRECTORY"/t3901/8859-1.txt &&
|
||||
test_commit "iso-c-commit" iso-under-c &&
|
||||
git show >out 2>err &&
|
||||
! test -s err &&
|
||||
test_must_be_empty err &&
|
||||
grep -q "iso-c-commit" out
|
||||
'
|
||||
|
||||
@ -19,7 +19,7 @@ test_expect_success GETTEXT_LOCALE 'git show a ISO-8859-1 commit under a UTF-8 l
|
||||
. "$TEST_DIRECTORY"/t3901/8859-1.txt &&
|
||||
test_commit "iso-utf8-commit" iso-under-utf8 &&
|
||||
LANGUAGE=is LC_ALL="$is_IS_locale" git show >out 2>err &&
|
||||
! test -s err &&
|
||||
test_must_be_empty err &&
|
||||
grep -q "iso-utf8-commit" out
|
||||
'
|
||||
|
||||
|
@ -346,12 +346,9 @@ test_expect_success 'working --list' '
|
||||
git config --list > output &&
|
||||
test_cmp expect output
|
||||
'
|
||||
cat > expect << EOF
|
||||
EOF
|
||||
|
||||
test_expect_success '--list without repo produces empty output' '
|
||||
git --git-dir=nonexistent config --list >output &&
|
||||
test_cmp expect output
|
||||
test_must_be_empty output
|
||||
'
|
||||
|
||||
cat > expect << EOF
|
||||
|
@ -290,9 +290,8 @@ test_expect_success 'stale dirs do not cause d/f conflicts (reflogs off)' '
|
||||
# same as before, but we only create a reflog for "one" if
|
||||
# it already exists, which it does not
|
||||
git -c core.logallrefupdates=false branch one master &&
|
||||
: >expect &&
|
||||
git log -g --format="%gd %gs" one >actual &&
|
||||
test_cmp expect actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
# Triggering the bug detected by this test requires a newline to fall
|
||||
|
@ -136,13 +136,12 @@ test_expect_success '--date magic does not override explicit @{0} syntax' '
|
||||
test_cmp expect actual
|
||||
'
|
||||
|
||||
: >expect
|
||||
test_expect_success 'empty reflog file' '
|
||||
git branch empty &&
|
||||
git reflog expire --expire=all refs/heads/empty &&
|
||||
|
||||
git log -g empty >actual &&
|
||||
test_cmp expect actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
# This guards against the alternative of showing the diffs vs. the
|
||||
|
@ -16,8 +16,7 @@ test_expect_success setup '
|
||||
git checkout HEAD^0 &&
|
||||
test_commit B fileB two &&
|
||||
git tag -d A B &&
|
||||
git reflog expire --expire=now --all &&
|
||||
>empty
|
||||
git reflog expire --expire=now --all
|
||||
'
|
||||
|
||||
test_expect_success 'loose objects borrowed from alternate are not missing' '
|
||||
@ -29,12 +28,12 @@ test_expect_success 'loose objects borrowed from alternate are not missing' '
|
||||
test_commit C fileC one &&
|
||||
git fsck --no-dangling >../actual 2>&1
|
||||
) &&
|
||||
test_cmp empty actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'HEAD is part of refs, valid objects appear valid' '
|
||||
git fsck >actual 2>&1 &&
|
||||
test_cmp empty actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
# Corruption tests follow. Make sure to remove all traces of the
|
||||
@ -346,12 +345,12 @@ test_expect_success 'tag with NUL in header' '
|
||||
|
||||
test_expect_success 'cleaned up' '
|
||||
git fsck >actual 2>&1 &&
|
||||
test_cmp empty actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'rev-list --verify-objects' '
|
||||
git rev-list --verify-objects --all >/dev/null 2>out &&
|
||||
test_cmp empty out
|
||||
test_must_be_empty out
|
||||
'
|
||||
|
||||
test_expect_success 'rev-list --verify-objects with bad sha1' '
|
||||
|
@ -41,7 +41,7 @@ test_expect_success 'setup: helper for testing rev-parse' '
|
||||
# rev-parse --show-prefix should output
|
||||
# a single newline when at the top of the work tree,
|
||||
# but we test for that separately.
|
||||
test -z "$4" && ! test -s actual.prefix ||
|
||||
test -z "$4" && test_must_be_empty actual.prefix ||
|
||||
test_cmp expected.prefix actual.prefix
|
||||
fi
|
||||
}
|
||||
|
@ -234,14 +234,14 @@ test_expect_success '#0: nonbare repo, no explicit configuration' '
|
||||
try_repo 0 unset unset unset "" unset \
|
||||
.git "$here/0" "$here/0" "(null)" \
|
||||
.git "$here/0" "$here/0" sub/ 2>message &&
|
||||
! test -s message
|
||||
test_must_be_empty message
|
||||
'
|
||||
|
||||
test_expect_success '#1: GIT_WORK_TREE without explicit GIT_DIR is accepted' '
|
||||
try_repo 1 "$here" unset unset "" unset \
|
||||
"$here/1/.git" "$here" "$here" 1/ \
|
||||
"$here/1/.git" "$here" "$here" 1/sub/ 2>message &&
|
||||
! test -s message
|
||||
test_must_be_empty message
|
||||
'
|
||||
|
||||
test_expect_success '#2: worktree defaults to cwd with explicit GIT_DIR' '
|
||||
@ -268,7 +268,7 @@ test_expect_success '#4: core.worktree without GIT_DIR set is accepted' '
|
||||
try_case 4 unset unset \
|
||||
.git "$here/4/sub" "$here/4" "(null)" \
|
||||
"$here/4/.git" "$here/4/sub" "$here/4/sub" "(null)" 2>message &&
|
||||
! test -s message
|
||||
test_must_be_empty message
|
||||
'
|
||||
|
||||
test_expect_success '#5: core.worktree + GIT_WORK_TREE is accepted' '
|
||||
@ -279,7 +279,7 @@ test_expect_success '#5: core.worktree + GIT_WORK_TREE is accepted' '
|
||||
try_repo 5a .. unset "$here/5a" "" unset \
|
||||
"$here/5a/.git" "$here" "$here" 5a/ \
|
||||
"$here/5a/.git" "$here/5a" "$here/5a" sub/ &&
|
||||
! test -s message
|
||||
test_must_be_empty message
|
||||
'
|
||||
|
||||
test_expect_success '#6: setting GIT_DIR brings core.worktree to life' '
|
||||
@ -376,7 +376,7 @@ test_expect_success '#9: GIT_WORK_TREE accepted with gitfile' '
|
||||
try_repo 9 wt unset unset gitfile unset \
|
||||
"$here/9.git" "$here/9/wt" "$here/9" "(null)" \
|
||||
"$here/9.git" "$here/9/sub/wt" "$here/9/sub" "(null)" 2>message &&
|
||||
! test -s message
|
||||
test_must_be_empty message
|
||||
'
|
||||
|
||||
test_expect_success '#10: GIT_DIR can point to gitfile' '
|
||||
@ -402,7 +402,7 @@ test_expect_success '#12: core.worktree with gitfile is accepted' '
|
||||
try_repo 12 unset unset "$here/12" gitfile unset \
|
||||
"$here/12.git" "$here/12" "$here/12" "(null)" \
|
||||
"$here/12.git" "$here/12" "$here/12" sub/ 2>message &&
|
||||
! test -s message
|
||||
test_must_be_empty message
|
||||
'
|
||||
|
||||
test_expect_success '#13: core.worktree+GIT_WORK_TREE accepted (with gitfile)' '
|
||||
@ -410,7 +410,7 @@ test_expect_success '#13: core.worktree+GIT_WORK_TREE accepted (with gitfile)' '
|
||||
try_repo 13 non-existent-too unset non-existent gitfile unset \
|
||||
"$here/13.git" "$here/13/non-existent-too" "$here/13" "(null)" \
|
||||
"$here/13.git" "$here/13/sub/non-existent-too" "$here/13/sub" "(null)" 2>message &&
|
||||
! test -s message
|
||||
test_must_be_empty message
|
||||
'
|
||||
|
||||
# case #14.
|
||||
@ -565,7 +565,7 @@ test_expect_success '#17: GIT_WORK_TREE without explicit GIT_DIR is accepted (ba
|
||||
try_repo 17c "$here/17c" unset unset "" true \
|
||||
.git "$here/17c" "$here/17c" "(null)" \
|
||||
"$here/17c/.git" "$here/17c" "$here/17c" sub/ 2>message &&
|
||||
! test -s message
|
||||
test_must_be_empty message
|
||||
'
|
||||
|
||||
test_expect_success '#18: bare .git named by GIT_DIR has no worktree' '
|
||||
@ -594,7 +594,7 @@ test_expect_success '#20a: core.worktree without GIT_DIR accepted (inside .git)'
|
||||
"$here/20a/.git" "$here/20a" "$here/20a" .git/wt/ &&
|
||||
try_case 20a/.git/wt/sub unset unset \
|
||||
"$here/20a/.git" "$here/20a" "$here/20a" .git/wt/sub/ &&
|
||||
! test -s message
|
||||
test_must_be_empty message
|
||||
'
|
||||
|
||||
test_expect_success '#20b/c: core.worktree and core.bare conflict' '
|
||||
@ -626,7 +626,7 @@ test_expect_success '#21: setup, core.worktree warns before overriding core.bare
|
||||
export GIT_WORK_TREE &&
|
||||
git status >/dev/null
|
||||
) 2>message &&
|
||||
! test -s message
|
||||
test_must_be_empty message
|
||||
|
||||
'
|
||||
run_wt_tests 21
|
||||
@ -742,7 +742,7 @@ test_expect_success '#25: GIT_WORK_TREE accepted if GIT_DIR unset (bare gitfile
|
||||
try_repo 25 "$here/25" unset unset gitfile true \
|
||||
"$here/25.git" "$here/25" "$here/25" "(null)" \
|
||||
"$here/25.git" "$here/25" "$here/25" "sub/" 2>message &&
|
||||
! test -s message
|
||||
test_must_be_empty message
|
||||
'
|
||||
|
||||
test_expect_success '#26: bare repo has no worktree (GIT_DIR -> gitfile case)' '
|
||||
@ -780,7 +780,7 @@ test_expect_success '#29: setup' '
|
||||
export GIT_WORK_TREE &&
|
||||
git status
|
||||
) 2>message &&
|
||||
! test -s message
|
||||
test_must_be_empty message
|
||||
'
|
||||
run_wt_tests 29 gitfile
|
||||
|
||||
|
@ -41,8 +41,7 @@ test_expect_success 'no warning with bogus GIT_INDEX_VERSION and existing index'
|
||||
GIT_INDEX_VERSION=1 &&
|
||||
export GIT_INDEX_VERSION &&
|
||||
git add a 2>actual.err &&
|
||||
>expect.err &&
|
||||
test_i18ncmp expect.err actual.err
|
||||
test_must_be_empty actual.err
|
||||
)
|
||||
'
|
||||
|
||||
|
@ -143,9 +143,7 @@ test_expect_success 'remove file not in base index' '
|
||||
test_expect_success 'remove file in base index' '
|
||||
git update-index --force-remove one &&
|
||||
git ls-files --stage >ls-files.actual &&
|
||||
cat >ls-files.expect <<-EOF &&
|
||||
EOF
|
||||
test_cmp ls-files.expect ls-files.actual &&
|
||||
test_must_be_empty ls-files.actual &&
|
||||
|
||||
test-tool dump-split-index .git/index | sed "/^own/d" >actual &&
|
||||
cat >expect <<-EOF &&
|
||||
|
@ -44,7 +44,7 @@ test_expect_success '"checkout <submodule>" honors diff.ignoreSubmodules' '
|
||||
git config diff.ignoreSubmodules dirty &&
|
||||
echo x> submodule/untracked &&
|
||||
git checkout HEAD >actual 2>&1 &&
|
||||
! test -s actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success '"checkout <submodule>" honors submodule.*.ignore from .gitmodules' '
|
||||
@ -52,7 +52,7 @@ test_expect_success '"checkout <submodule>" honors submodule.*.ignore from .gitm
|
||||
git config -f .gitmodules submodule.submodule.path submodule &&
|
||||
git config -f .gitmodules submodule.submodule.ignore untracked &&
|
||||
git checkout HEAD >actual 2>&1 &&
|
||||
! test -s actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success '"checkout <submodule>" honors submodule.*.ignore from .git/config' '
|
||||
@ -60,7 +60,7 @@ test_expect_success '"checkout <submodule>" honors submodule.*.ignore from .git/
|
||||
git config submodule.submodule.path submodule &&
|
||||
git config submodule.submodule.ignore all &&
|
||||
git checkout HEAD >actual 2>&1 &&
|
||||
! test -s actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
KNOWN_FAILURE_DIRECTORY_SUBMODULE_CONFLICTS=1
|
||||
|
@ -252,6 +252,11 @@ test_expect_success 'add -B' '
|
||||
test_cmp_rev master^ poodle
|
||||
'
|
||||
|
||||
test_expect_success 'add --quiet' '
|
||||
git worktree add --quiet another-worktree master 2>actual &&
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'local clone from linked checkout' '
|
||||
git clone --local here here-clone &&
|
||||
( cd here-clone && git fsck )
|
||||
|
@ -88,9 +88,8 @@ test_expect_success 'non-qualified update in subdir updates from the root' '
|
||||
echo even more >>sub2 &&
|
||||
git add -u
|
||||
) &&
|
||||
: >expect &&
|
||||
git diff-files --name-only >actual &&
|
||||
test_cmp expect actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'replace a file with a symlink' '
|
||||
|
@ -195,8 +195,7 @@ test_expect_success 'rename detection finds the right names' '
|
||||
test_cmp expected.4 actual.4 &&
|
||||
|
||||
git diff --cached --stat >actual.5 &&
|
||||
: >expected.5 &&
|
||||
test_cmp expected.5 actual.5
|
||||
test_must_be_empty actual.5
|
||||
|
||||
)
|
||||
'
|
||||
@ -241,8 +240,7 @@ test_expect_success 'diff-files/diff-cached shows ita as new/not-new files' '
|
||||
echo " create mode 100644 new-ita" >expected &&
|
||||
test_cmp expected actual &&
|
||||
git diff --cached --summary >actual2 &&
|
||||
: >expected2 &&
|
||||
test_cmp expected2 actual2
|
||||
test_must_be_empty actual2
|
||||
'
|
||||
|
||||
|
||||
|
@ -31,7 +31,7 @@ do
|
||||
rm -f .git/index &&
|
||||
test_must_fail git add "$i" 2>err &&
|
||||
git ls-files "$i" >out &&
|
||||
! test -s out
|
||||
test_must_be_empty out
|
||||
'
|
||||
|
||||
test_expect_success "complaints for ignored $i output" '
|
||||
@ -42,7 +42,7 @@ do
|
||||
rm -f .git/index &&
|
||||
test_must_fail git add "$i" file 2>err &&
|
||||
git ls-files "$i" >out &&
|
||||
! test -s out
|
||||
test_must_be_empty out
|
||||
'
|
||||
test_expect_success "complaints for ignored $i with unignored file output" '
|
||||
test_i18ngrep -e "Use -f if" err
|
||||
@ -57,7 +57,7 @@ do
|
||||
cd dir &&
|
||||
test_must_fail git add "$i" 2>err &&
|
||||
git ls-files "$i" >out &&
|
||||
! test -s out
|
||||
test_must_be_empty out
|
||||
)
|
||||
'
|
||||
|
||||
@ -77,7 +77,7 @@ do
|
||||
cd sub &&
|
||||
test_must_fail git add "$i" 2>err &&
|
||||
git ls-files "$i" >out &&
|
||||
! test -s out
|
||||
test_must_be_empty out
|
||||
)
|
||||
'
|
||||
|
||||
|
@ -277,9 +277,8 @@ test_expect_success 'hide empty ignored sub-directory with --no-empty-directory'
|
||||
'
|
||||
|
||||
test_expect_success 'pattern matches prefix completely' '
|
||||
: >expect &&
|
||||
git ls-files -i -o --exclude "/three/a.3[abc]" >actual &&
|
||||
test_cmp expect actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'ls-files with "**" patterns' '
|
||||
@ -295,9 +294,8 @@ EOF
|
||||
|
||||
|
||||
test_expect_success 'ls-files with "**" patterns and no slashes' '
|
||||
: >expect &&
|
||||
git ls-files -o -i --exclude "one**a.1" >actual &&
|
||||
test_cmp expect actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_done
|
||||
|
@ -8,16 +8,14 @@ command-line arguments.
|
||||
|
||||
. ./test-lib.sh
|
||||
|
||||
>empty
|
||||
|
||||
test_expect_success 'ls-files in empty repository' '
|
||||
git ls-files >actual &&
|
||||
test_cmp empty actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'ls-files with nonexistent path' '
|
||||
git ls-files doesnotexist >actual &&
|
||||
test_cmp empty actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'ls-files with nonsense option' '
|
||||
|
@ -17,7 +17,6 @@ test_commit_this () {
|
||||
}
|
||||
|
||||
test_expect_success 'setup' '
|
||||
: >empty &&
|
||||
test_file checked-out init &&
|
||||
test_file modify_delete modify_delete_init &&
|
||||
test_commit_this init &&
|
||||
@ -38,7 +37,7 @@ test_expect_success 'reset --hard works after the conflict' '
|
||||
|
||||
test_expect_success 'is reset properly' '
|
||||
git status --porcelain -- modify_delete >out &&
|
||||
test_cmp empty out &&
|
||||
test_must_be_empty out &&
|
||||
test_path_is_missing modify_delete
|
||||
'
|
||||
|
||||
@ -52,7 +51,7 @@ test_expect_success 'Merge abort works after the conflict' '
|
||||
|
||||
test_expect_success 'is aborted properly' '
|
||||
git status --porcelain -- modify_delete >out &&
|
||||
test_cmp empty out &&
|
||||
test_must_be_empty out &&
|
||||
test_path_is_missing modify_delete
|
||||
'
|
||||
|
||||
|
@ -1305,4 +1305,50 @@ test_expect_success 'tracking with unexpected .fetch refspec' '
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_success 'configured committerdate sort' '
|
||||
git init sort &&
|
||||
(
|
||||
cd sort &&
|
||||
git config branch.sort committerdate &&
|
||||
test_commit initial &&
|
||||
git checkout -b a &&
|
||||
test_commit a &&
|
||||
git checkout -b c &&
|
||||
test_commit c &&
|
||||
git checkout -b b &&
|
||||
test_commit b &&
|
||||
git branch >actual &&
|
||||
cat >expect <<-\EOF &&
|
||||
master
|
||||
a
|
||||
c
|
||||
* b
|
||||
EOF
|
||||
test_cmp expect actual
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_success 'option override configured sort' '
|
||||
(
|
||||
cd sort &&
|
||||
git config branch.sort committerdate &&
|
||||
git branch --sort=refname >actual &&
|
||||
cat >expect <<-\EOF &&
|
||||
a
|
||||
* b
|
||||
c
|
||||
master
|
||||
EOF
|
||||
test_cmp expect actual
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_success 'invalid sort parameter in configuration' '
|
||||
(
|
||||
cd sort &&
|
||||
git config branch.sort "v:notvalid" &&
|
||||
test_must_fail git branch
|
||||
)
|
||||
'
|
||||
|
||||
test_done
|
||||
|
@ -127,7 +127,7 @@ test_expect_success 'explicit pack-refs with dangling packed reference' '
|
||||
git reflog expire --expire=all --all &&
|
||||
git prune --expire=all &&
|
||||
git pack-refs --all 2>result &&
|
||||
test_cmp /dev/null result
|
||||
test_must_be_empty result
|
||||
'
|
||||
|
||||
test_expect_success 'delete ref with dangling packed version' '
|
||||
@ -139,7 +139,7 @@ test_expect_success 'delete ref with dangling packed version' '
|
||||
git reflog expire --expire=all --all &&
|
||||
git prune --expire=all &&
|
||||
git branch -d lamb 2>result &&
|
||||
test_cmp /dev/null result
|
||||
test_must_be_empty result
|
||||
'
|
||||
|
||||
test_expect_success 'delete ref while another dangling packed ref' '
|
||||
@ -150,7 +150,7 @@ test_expect_success 'delete ref while another dangling packed ref' '
|
||||
git reflog expire --expire=all --all &&
|
||||
git prune --expire=all &&
|
||||
git branch -d lamb 2>result &&
|
||||
test_cmp /dev/null result
|
||||
test_must_be_empty result
|
||||
'
|
||||
|
||||
test_expect_success 'pack ref directly below refs/' '
|
||||
|
@ -481,10 +481,8 @@ test_expect_success 'list specific note with "git notes list <object>"' '
|
||||
'
|
||||
|
||||
test_expect_success 'listing non-existing notes fails' '
|
||||
cat >expect <<-EOF &&
|
||||
EOF
|
||||
test_must_fail git notes list HEAD >actual &&
|
||||
test_cmp expect actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'append to existing note with "git notes append"' '
|
||||
|
@ -183,7 +183,7 @@ test_expect_success 'merge empty notes ref (z => y)' '
|
||||
git notes add -m "foo" &&
|
||||
git notes remove &&
|
||||
git notes >output_notes_z &&
|
||||
test_cmp /dev/null output_notes_z &&
|
||||
test_must_be_empty output_notes_z &&
|
||||
# Do the merge (z => y)
|
||||
git config core.notesRef refs/notes/y &&
|
||||
git notes merge z &&
|
||||
|
@ -337,7 +337,7 @@ EOF
|
||||
git notes merge --commit &&
|
||||
# No .git/NOTES_MERGE_* files left
|
||||
test_might_fail ls .git/NOTES_MERGE_* >output 2>/dev/null &&
|
||||
test_cmp /dev/null output &&
|
||||
test_must_be_empty output &&
|
||||
# Merge commit has pre-merge y and pre-merge z as parents
|
||||
test "$(git rev-parse refs/notes/m^1)" = "$(cat pre_merge_y)" &&
|
||||
test "$(git rev-parse refs/notes/m^2)" = "$(cat pre_merge_z)" &&
|
||||
@ -399,7 +399,7 @@ test_expect_success 'abort notes merge' '
|
||||
git notes merge --abort &&
|
||||
# No .git/NOTES_MERGE_* files left
|
||||
test_might_fail ls .git/NOTES_MERGE_* >output 2>/dev/null &&
|
||||
test_cmp /dev/null output &&
|
||||
test_must_be_empty output &&
|
||||
# m has not moved (still == y)
|
||||
test "$(git rev-parse refs/notes/m)" = "$(cat pre_merge_y)" &&
|
||||
# Verify that other notes refs has not changed (w, x, y and z)
|
||||
@ -466,7 +466,7 @@ EOF
|
||||
git notes merge --commit &&
|
||||
# No .git/NOTES_MERGE_* files left
|
||||
test_might_fail ls .git/NOTES_MERGE_* >output 2>/dev/null &&
|
||||
test_cmp /dev/null output &&
|
||||
test_must_be_empty output &&
|
||||
# Merge commit has pre-merge y and pre-merge z as parents
|
||||
test "$(git rev-parse refs/notes/m^1)" = "$(cat pre_merge_y)" &&
|
||||
test "$(git rev-parse refs/notes/m^2)" = "$(cat pre_merge_z)" &&
|
||||
@ -555,7 +555,7 @@ test_expect_success 'resolve situation by aborting the notes merge' '
|
||||
git notes merge --abort &&
|
||||
# No .git/NOTES_MERGE_* files left
|
||||
test_might_fail ls .git/NOTES_MERGE_* >output 2>/dev/null &&
|
||||
test_cmp /dev/null output &&
|
||||
test_must_be_empty output &&
|
||||
# m has not moved (still == w)
|
||||
test "$(git rev-parse refs/notes/m)" = "$(git rev-parse refs/notes/w)" &&
|
||||
# Verify that other notes refs has not changed (w, x, y and z)
|
||||
|
@ -796,16 +796,15 @@ test_expect_success 'always cherry-pick with --no-ff' '
|
||||
git tag original-no-ff-branch &&
|
||||
set_fake_editor &&
|
||||
git rebase -i --no-ff A &&
|
||||
touch empty &&
|
||||
for p in 0 1 2
|
||||
do
|
||||
test ! $(git rev-parse HEAD~$p) = $(git rev-parse original-no-ff-branch~$p) &&
|
||||
git diff HEAD~$p original-no-ff-branch~$p > out &&
|
||||
test_cmp empty out
|
||||
test_must_be_empty out
|
||||
done &&
|
||||
test $(git rev-parse HEAD~3) = $(git rev-parse original-no-ff-branch~3) &&
|
||||
git diff HEAD~3 original-no-ff-branch~3 > out &&
|
||||
test_cmp empty out
|
||||
test_must_be_empty out
|
||||
'
|
||||
|
||||
test_expect_success 'set up commits with funny messages' '
|
||||
|
@ -202,7 +202,7 @@ testrebase () {
|
||||
echo dirty >>file3 &&
|
||||
test_must_fail git rebase$type related-onto-branch &&
|
||||
test_path_is_file $dotest/autostash &&
|
||||
! grep dirty file3 &&
|
||||
test_path_is_missing file3 &&
|
||||
rm -rf $dotest &&
|
||||
git reset --hard &&
|
||||
git checkout feature-branch
|
||||
@ -216,7 +216,7 @@ testrebase () {
|
||||
echo dirty >>file3 &&
|
||||
test_must_fail git rebase$type related-onto-branch &&
|
||||
test_path_is_file $dotest/autostash &&
|
||||
! grep dirty file3 &&
|
||||
test_path_is_missing file3 &&
|
||||
echo "conflicting-plus-goodbye" >file2 &&
|
||||
git add file2 &&
|
||||
git rebase --continue &&
|
||||
@ -233,7 +233,7 @@ testrebase () {
|
||||
echo dirty >>file3 &&
|
||||
test_must_fail git rebase$type related-onto-branch &&
|
||||
test_path_is_file $dotest/autostash &&
|
||||
! grep dirty file3 &&
|
||||
test_path_is_missing file3 &&
|
||||
git rebase --skip &&
|
||||
test_path_is_missing $dotest/autostash &&
|
||||
grep dirty file3 &&
|
||||
@ -248,7 +248,7 @@ testrebase () {
|
||||
echo dirty >>file3 &&
|
||||
test_must_fail git rebase$type related-onto-branch &&
|
||||
test_path_is_file $dotest/autostash &&
|
||||
! grep dirty file3 &&
|
||||
test_path_is_missing file3 &&
|
||||
git rebase --abort &&
|
||||
test_path_is_missing $dotest/autostash &&
|
||||
grep dirty file3 &&
|
||||
|
@ -380,7 +380,7 @@ test_expect_success 'rm does not complain when no .gitmodules file is found' '
|
||||
git submodule update &&
|
||||
git rm .gitmodules &&
|
||||
git rm submod >actual 2>actual.err &&
|
||||
! test -s actual.err &&
|
||||
test_must_be_empty actual.err &&
|
||||
! test -d submod &&
|
||||
! test -f submod/.git &&
|
||||
git status -s -uno >actual &&
|
||||
@ -398,7 +398,7 @@ test_expect_success 'rm will error out on a modified .gitmodules file unless sta
|
||||
git diff-files --quiet -- submod &&
|
||||
git add .gitmodules &&
|
||||
git rm submod >actual 2>actual.err &&
|
||||
! test -s actual.err &&
|
||||
test_must_be_empty actual.err &&
|
||||
! test -d submod &&
|
||||
! test -f submod/.git &&
|
||||
git status -s -uno >actual &&
|
||||
@ -692,7 +692,7 @@ test_expect_success 'checking out a commit after submodule removal needs manual
|
||||
test_cmp expected actual &&
|
||||
rm -rf submod &&
|
||||
git status -s -uno --ignore-submodules=none >actual &&
|
||||
! test -s actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'rm of d/f when d has become a non-directory' '
|
||||
|
@ -724,7 +724,7 @@ test_expect_success 'store updates stash ref and reflog' '
|
||||
git add bazzy &&
|
||||
STASH_ID=$(git stash create) &&
|
||||
git reset --hard &&
|
||||
! grep quux bazzy &&
|
||||
test_path_is_missing bazzy &&
|
||||
git stash store -m quuxery $STASH_ID &&
|
||||
test $(git rev-parse stash) = $STASH_ID &&
|
||||
git reflog --format=%H stash| grep $STASH_ID &&
|
||||
|
@ -126,7 +126,7 @@ test_expect_success SYMLINKS 'diff symlinks with non-existing targets' '
|
||||
ln -s take\ over brain &&
|
||||
test_must_fail git diff --no-index pinky brain >output 2>output.err &&
|
||||
grep narf output &&
|
||||
! test -s output.err
|
||||
test_must_be_empty output.err
|
||||
'
|
||||
|
||||
test_expect_success SYMLINKS 'setup symlinks with attributes' '
|
||||
|
@ -776,8 +776,6 @@ test_expect_success 'checkdiff allows new blank lines' '
|
||||
git diff --check
|
||||
'
|
||||
|
||||
cat <<EOF >expect
|
||||
EOF
|
||||
test_expect_success 'whitespace-only changes not reported' '
|
||||
git reset --hard &&
|
||||
echo >x "hello world" &&
|
||||
@ -785,7 +783,7 @@ test_expect_success 'whitespace-only changes not reported' '
|
||||
git commit -m "hello 1" &&
|
||||
echo >x "hello world" &&
|
||||
git diff -b >actual &&
|
||||
test_cmp expect actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
cat <<EOF >expect
|
||||
|
@ -260,7 +260,7 @@ test_expect_success 'trailing empty lines (2)' '
|
||||
|
||||
echo "F -whitespace" >.gitattributes &&
|
||||
git diff --check >output &&
|
||||
! test -s output
|
||||
test_must_be_empty output
|
||||
|
||||
'
|
||||
|
||||
|
@ -104,19 +104,19 @@ test_expect_success 'git diff HEAD with dirty submodule (work tree, refs match)'
|
||||
expect_from_to >expect.body $subprev $subprev-dirty &&
|
||||
test_cmp expect.body actual.body &&
|
||||
git diff --ignore-submodules HEAD >actual2 &&
|
||||
! test -s actual2 &&
|
||||
test_must_be_empty actual2 &&
|
||||
git diff --ignore-submodules=untracked HEAD >actual3 &&
|
||||
sed -e "1,/^@@/d" actual3 >actual3.body &&
|
||||
expect_from_to >expect.body $subprev $subprev-dirty &&
|
||||
test_cmp expect.body actual3.body &&
|
||||
git diff --ignore-submodules=dirty HEAD >actual4 &&
|
||||
! test -s actual4
|
||||
test_must_be_empty actual4
|
||||
'
|
||||
|
||||
test_expect_success 'git diff HEAD with dirty submodule (work tree, refs match) [.gitmodules]' '
|
||||
git config diff.ignoreSubmodules dirty &&
|
||||
git diff HEAD >actual &&
|
||||
! test -s actual &&
|
||||
test_must_be_empty actual &&
|
||||
git config --add -f .gitmodules submodule.subname.ignore none &&
|
||||
git config --add -f .gitmodules submodule.subname.path sub &&
|
||||
git diff HEAD >actual &&
|
||||
@ -126,7 +126,7 @@ test_expect_success 'git diff HEAD with dirty submodule (work tree, refs match)
|
||||
git config -f .gitmodules submodule.subname.ignore all &&
|
||||
git config -f .gitmodules submodule.subname.path sub &&
|
||||
git diff HEAD >actual2 &&
|
||||
! test -s actual2 &&
|
||||
test_must_be_empty actual2 &&
|
||||
git config -f .gitmodules submodule.subname.ignore untracked &&
|
||||
git diff HEAD >actual3 &&
|
||||
sed -e "1,/^@@/d" actual3 >actual3.body &&
|
||||
@ -134,7 +134,7 @@ test_expect_success 'git diff HEAD with dirty submodule (work tree, refs match)
|
||||
test_cmp expect.body actual3.body &&
|
||||
git config -f .gitmodules submodule.subname.ignore dirty &&
|
||||
git diff HEAD >actual4 &&
|
||||
! test -s actual4 &&
|
||||
test_must_be_empty actual4 &&
|
||||
git config submodule.subname.ignore none &&
|
||||
git config submodule.subname.path sub &&
|
||||
git diff HEAD >actual &&
|
||||
@ -172,24 +172,24 @@ test_expect_success 'git diff HEAD with dirty submodule (untracked, refs match)'
|
||||
expect_from_to >expect.body $subprev $subprev-dirty &&
|
||||
test_cmp expect.body actual.body &&
|
||||
git diff --ignore-submodules=all HEAD >actual2 &&
|
||||
! test -s actual2 &&
|
||||
test_must_be_empty actual2 &&
|
||||
git diff --ignore-submodules=untracked HEAD >actual3 &&
|
||||
! test -s actual3 &&
|
||||
test_must_be_empty actual3 &&
|
||||
git diff --ignore-submodules=dirty HEAD >actual4 &&
|
||||
! test -s actual4
|
||||
test_must_be_empty actual4
|
||||
'
|
||||
|
||||
test_expect_success 'git diff HEAD with dirty submodule (untracked, refs match) [.gitmodules]' '
|
||||
git config --add -f .gitmodules submodule.subname.ignore all &&
|
||||
git config --add -f .gitmodules submodule.subname.path sub &&
|
||||
git diff HEAD >actual2 &&
|
||||
! test -s actual2 &&
|
||||
test_must_be_empty actual2 &&
|
||||
git config -f .gitmodules submodule.subname.ignore untracked &&
|
||||
git diff HEAD >actual3 &&
|
||||
! test -s actual3 &&
|
||||
test_must_be_empty actual3 &&
|
||||
git config -f .gitmodules submodule.subname.ignore dirty &&
|
||||
git diff HEAD >actual4 &&
|
||||
! test -s actual4 &&
|
||||
test_must_be_empty actual4 &&
|
||||
git config submodule.subname.ignore none &&
|
||||
git config submodule.subname.path sub &&
|
||||
git diff HEAD >actual &&
|
||||
@ -211,7 +211,7 @@ test_expect_success 'git diff between submodule commits' '
|
||||
expect_from_to >expect.body $subtip $subprev &&
|
||||
test_cmp expect.body actual.body &&
|
||||
git diff --ignore-submodules HEAD^..HEAD >actual &&
|
||||
! test -s actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'git diff between submodule commits [.gitmodules]' '
|
||||
@ -227,7 +227,7 @@ test_expect_success 'git diff between submodule commits [.gitmodules]' '
|
||||
test_cmp expect.body actual.body &&
|
||||
git config -f .gitmodules submodule.subname.ignore all &&
|
||||
git diff HEAD^..HEAD >actual &&
|
||||
! test -s actual &&
|
||||
test_must_be_empty actual &&
|
||||
git config submodule.subname.ignore dirty &&
|
||||
git config submodule.subname.path sub &&
|
||||
git diff HEAD^..HEAD >actual &&
|
||||
@ -239,10 +239,9 @@ test_expect_success 'git diff between submodule commits [.gitmodules]' '
|
||||
'
|
||||
|
||||
test_expect_success 'git diff (empty submodule dir)' '
|
||||
: >empty &&
|
||||
rm -rf sub/* sub/.git &&
|
||||
git diff > actual.empty &&
|
||||
test_cmp empty actual.empty
|
||||
test_must_be_empty actual.empty
|
||||
'
|
||||
|
||||
test_expect_success 'conflicted submodule setup' '
|
||||
|
@ -257,9 +257,7 @@ test_expect_success 'typechanged submodule(blob->submodule)' '
|
||||
commit_file sm1 &&
|
||||
test_expect_success 'submodule is up to date' '
|
||||
git diff-index -p --submodule=log HEAD >actual &&
|
||||
cat >expected <<-EOF &&
|
||||
EOF
|
||||
test_cmp expected actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'submodule contains untracked content' '
|
||||
@ -273,17 +271,17 @@ test_expect_success 'submodule contains untracked content' '
|
||||
|
||||
test_expect_success 'submodule contains untracked content (untracked ignored)' '
|
||||
git diff-index -p --ignore-submodules=untracked --submodule=log HEAD >actual &&
|
||||
! test -s actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'submodule contains untracked content (dirty ignored)' '
|
||||
git diff-index -p --ignore-submodules=dirty --submodule=log HEAD >actual &&
|
||||
! test -s actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'submodule contains untracked content (all ignored)' '
|
||||
git diff-index -p --ignore-submodules=all --submodule=log HEAD >actual &&
|
||||
! test -s actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'submodule contains untracked and modifed content' '
|
||||
@ -308,13 +306,13 @@ test_expect_success 'submodule contains untracked and modifed content (untracked
|
||||
test_expect_success 'submodule contains untracked and modifed content (dirty ignored)' '
|
||||
echo new > sm1/foo6 &&
|
||||
git diff-index -p --ignore-submodules=dirty --submodule=log HEAD >actual &&
|
||||
! test -s actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'submodule contains untracked and modifed content (all ignored)' '
|
||||
echo new > sm1/foo6 &&
|
||||
git diff-index -p --ignore-submodules --submodule=log HEAD >actual &&
|
||||
! test -s actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'submodule contains modifed content' '
|
||||
@ -368,7 +366,7 @@ test_expect_success 'modified submodule contains untracked content (dirty ignore
|
||||
|
||||
test_expect_success 'modified submodule contains untracked content (all ignored)' '
|
||||
git diff-index -p --ignore-submodules=all --submodule=log HEAD >actual &&
|
||||
! test -s actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'modified submodule contains untracked and modifed content' '
|
||||
@ -407,7 +405,7 @@ test_expect_success 'modified submodule contains untracked and modifed content (
|
||||
test_expect_success 'modified submodule contains untracked and modifed content (all ignored)' '
|
||||
echo modification >> sm1/foo6 &&
|
||||
git diff-index -p --ignore-submodules --submodule=log HEAD >actual &&
|
||||
! test -s actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'modified submodule contains modifed content' '
|
||||
|
@ -940,7 +940,7 @@ test_expect_success 'diff.dirstat=0,lines' '
|
||||
test_expect_success '--dirstat=future_param,lines,0 should fail loudly' '
|
||||
test_must_fail git diff --dirstat=future_param,lines,0 HEAD^..HEAD >actual_diff_dirstat 2>actual_error &&
|
||||
test_debug "cat actual_error" &&
|
||||
test_cmp /dev/null actual_diff_dirstat &&
|
||||
test_must_be_empty actual_diff_dirstat &&
|
||||
test_i18ngrep -q "future_param" actual_error &&
|
||||
test_i18ngrep -q "\--dirstat" actual_error
|
||||
'
|
||||
@ -948,7 +948,7 @@ test_expect_success '--dirstat=future_param,lines,0 should fail loudly' '
|
||||
test_expect_success '--dirstat=dummy1,cumulative,2dummy should report both unrecognized parameters' '
|
||||
test_must_fail git diff --dirstat=dummy1,cumulative,2dummy HEAD^..HEAD >actual_diff_dirstat 2>actual_error &&
|
||||
test_debug "cat actual_error" &&
|
||||
test_cmp /dev/null actual_diff_dirstat &&
|
||||
test_must_be_empty actual_diff_dirstat &&
|
||||
test_i18ngrep -q "dummy1" actual_error &&
|
||||
test_i18ngrep -q "2dummy" actual_error &&
|
||||
test_i18ngrep -q "\--dirstat" actual_error
|
||||
|
@ -174,7 +174,7 @@ test_expect_success ' context does not include other functions' '
|
||||
'
|
||||
|
||||
test_expect_success ' context does not include preceding empty lines' '
|
||||
test "$(first_context_line <long_common_tail.diff.diff)" != " "
|
||||
test "$(first_context_line <long_common_tail.diff)" != " "
|
||||
'
|
||||
|
||||
check_diff changed_hello_appended 'changed function plus appended function'
|
||||
|
@ -392,9 +392,7 @@ test_expect_success 'typechanged submodule(blob->submodule)' '
|
||||
commit_file sm1 &&
|
||||
test_expect_success 'submodule is up to date' '
|
||||
git diff-index -p --submodule=diff HEAD >actual &&
|
||||
cat >expected <<-EOF &&
|
||||
EOF
|
||||
test_cmp expected actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'submodule contains untracked content' '
|
||||
@ -408,17 +406,17 @@ test_expect_success 'submodule contains untracked content' '
|
||||
|
||||
test_expect_success 'submodule contains untracked content (untracked ignored)' '
|
||||
git diff-index -p --ignore-submodules=untracked --submodule=diff HEAD >actual &&
|
||||
! test -s actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'submodule contains untracked content (dirty ignored)' '
|
||||
git diff-index -p --ignore-submodules=dirty --submodule=diff HEAD >actual &&
|
||||
! test -s actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'submodule contains untracked content (all ignored)' '
|
||||
git diff-index -p --ignore-submodules=all --submodule=diff HEAD >actual &&
|
||||
! test -s actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'submodule contains untracked and modified content' '
|
||||
@ -458,13 +456,13 @@ test_expect_success 'submodule contains untracked and modified content (untracke
|
||||
test_expect_success 'submodule contains untracked and modified content (dirty ignored)' '
|
||||
echo new > sm1/foo6 &&
|
||||
git diff-index -p --ignore-submodules=dirty --submodule=diff HEAD >actual &&
|
||||
! test -s actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'submodule contains untracked and modified content (all ignored)' '
|
||||
echo new > sm1/foo6 &&
|
||||
git diff-index -p --ignore-submodules --submodule=diff HEAD >actual &&
|
||||
! test -s actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'submodule contains modified content' '
|
||||
@ -549,7 +547,7 @@ test_expect_success 'modified submodule contains untracked content (dirty ignore
|
||||
|
||||
test_expect_success 'modified submodule contains untracked content (all ignored)' '
|
||||
git diff-index -p --ignore-submodules=all --submodule=diff HEAD >actual &&
|
||||
! test -s actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'modified submodule contains untracked and modified content' '
|
||||
@ -609,7 +607,7 @@ test_expect_success 'modified submodule contains untracked and modified content
|
||||
test_expect_success 'modified submodule contains untracked and modified content (all ignored)' '
|
||||
echo modification >> sm1/foo6 &&
|
||||
git diff-index -p --ignore-submodules --submodule=diff HEAD >actual &&
|
||||
! test -s actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
# NOT OK
|
||||
|
@ -42,7 +42,7 @@ test_expect_success 'apply in reverse' '
|
||||
git reset --hard second &&
|
||||
git apply --reverse --binary --index patch &&
|
||||
git diff >diff &&
|
||||
test_cmp /dev/null diff
|
||||
test_must_be_empty diff
|
||||
|
||||
'
|
||||
|
||||
|
@ -100,7 +100,7 @@ test_expect_success 'whitespace=warn, default rule' '
|
||||
test_expect_success 'whitespace=error-all, default rule' '
|
||||
|
||||
test_must_fail apply_patch --whitespace=error-all &&
|
||||
! test -s target
|
||||
test_must_be_empty target
|
||||
|
||||
'
|
||||
|
||||
|
@ -49,8 +49,7 @@ test_expect_success setup '
|
||||
sed -e "s/TS0/$timeGMT/" -e "s/TS1/$epocGMT/" <d >removeGMT.patch &&
|
||||
sed -e "s/TS0/$timeWest/" -e "s/TS1/$epocWest2/" <d >removeWest2.patch &&
|
||||
|
||||
echo something >something &&
|
||||
>empty
|
||||
echo something >something
|
||||
'
|
||||
|
||||
for patch in *.patch
|
||||
@ -81,7 +80,7 @@ do
|
||||
git add file &&
|
||||
git apply --index $patch &&
|
||||
test -f file &&
|
||||
test_cmp empty file
|
||||
test_must_be_empty file
|
||||
;;
|
||||
remove*)
|
||||
# must remove the file
|
||||
|
@ -652,7 +652,7 @@ test_expect_success 'am -3 -q is quiet' '
|
||||
git checkout -f lorem2 &&
|
||||
git reset base3way --hard &&
|
||||
git am -3 -q lorem-move.patch >output.out 2>&1 &&
|
||||
! test -s output.out
|
||||
test_must_be_empty output.out
|
||||
'
|
||||
|
||||
test_expect_success 'am pauses on conflict' '
|
||||
@ -875,7 +875,7 @@ test_expect_success 'am -q is quiet' '
|
||||
git checkout first &&
|
||||
test_tick &&
|
||||
git am -q <patch1 >output.out 2>&1 &&
|
||||
! test -s output.out
|
||||
test_must_be_empty output.out
|
||||
'
|
||||
|
||||
test_expect_success 'am empty-file does not infloop' '
|
||||
|
@ -192,7 +192,7 @@ test_expect_success 'shortlog with revision pseudo options' '
|
||||
|
||||
test_expect_success 'shortlog with --output=<file>' '
|
||||
git shortlog --output=shortlog -1 master >output &&
|
||||
test ! -s output &&
|
||||
test_must_be_empty output &&
|
||||
test_line_count = 3 shortlog
|
||||
'
|
||||
|
||||
|
@ -461,11 +461,9 @@ test_expect_success 'Grep author with log.mailmap' '
|
||||
test_cmp expect actual
|
||||
'
|
||||
|
||||
>expect
|
||||
|
||||
test_expect_success 'Only grep replaced author with --use-mailmap' '
|
||||
git log --use-mailmap --author "<cto@coompany.xx>" >actual &&
|
||||
test_cmp expect actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
# git blame
|
||||
|
@ -101,7 +101,7 @@ test_expect_success '-L with --first-parent and a merge' '
|
||||
test_expect_success '-L with --output' '
|
||||
git checkout parallel-change &&
|
||||
git log --output=log -L :main:b.c >output &&
|
||||
test ! -s output &&
|
||||
test_must_be_empty output &&
|
||||
test_line_count = 70 log
|
||||
'
|
||||
|
||||
|
@ -26,22 +26,20 @@ test_expect_success 'git log with broken author email' '
|
||||
echo
|
||||
echo " foo"
|
||||
} >expect.out &&
|
||||
: >expect.err &&
|
||||
|
||||
git log broken_email >actual.out 2>actual.err &&
|
||||
|
||||
test_cmp expect.out actual.out &&
|
||||
test_cmp expect.err actual.err
|
||||
test_must_be_empty actual.err
|
||||
'
|
||||
|
||||
test_expect_success 'git log --format with broken author email' '
|
||||
echo "A U Thor+author@example.com+Thu Apr 7 15:13:13 2005 -0700" >expect.out &&
|
||||
: >expect.err &&
|
||||
|
||||
git log --format="%an+%ae+%ad" broken_email >actual.out 2>actual.err &&
|
||||
|
||||
test_cmp expect.out actual.out &&
|
||||
test_cmp expect.err actual.err
|
||||
test_must_be_empty actual.err
|
||||
'
|
||||
|
||||
munge_author_date () {
|
||||
|
@ -25,25 +25,19 @@ EXPECTED
|
||||
'
|
||||
|
||||
test_expect_success 'file add !A, B' '
|
||||
cat >expected <<\EXPECTED &&
|
||||
EXPECTED
|
||||
|
||||
git reset --hard initial &&
|
||||
test_commit "add-not-a-b" "ONE" "AAA" &&
|
||||
git merge-tree initial add-not-a-b initial >actual &&
|
||||
test_cmp expected actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'file add A, B (same)' '
|
||||
cat >expected <<\EXPECTED &&
|
||||
EXPECTED
|
||||
|
||||
git reset --hard initial &&
|
||||
test_commit "add-a-b-same-A" "ONE" "AAA" &&
|
||||
git reset --hard initial &&
|
||||
test_commit "add-a-b-same-B" "ONE" "AAA" &&
|
||||
git merge-tree initial add-a-b-same-A add-a-b-same-B >actual &&
|
||||
test_cmp expected actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'file add A, B (different)' '
|
||||
@ -68,13 +62,10 @@ EXPECTED
|
||||
'
|
||||
|
||||
test_expect_success 'file change A, !B' '
|
||||
cat >expected <<\EXPECTED &&
|
||||
EXPECTED
|
||||
|
||||
git reset --hard initial &&
|
||||
test_commit "change-a-not-b" "initial-file" "BBB" &&
|
||||
git merge-tree initial change-a-not-b initial >actual &&
|
||||
test_cmp expected actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'file change !A, B' '
|
||||
@ -94,15 +85,12 @@ EXPECTED
|
||||
'
|
||||
|
||||
test_expect_success 'file change A, B (same)' '
|
||||
cat >expected <<\EXPECTED &&
|
||||
EXPECTED
|
||||
|
||||
git reset --hard initial &&
|
||||
test_commit "change-a-b-same-A" "initial-file" "AAA" &&
|
||||
git reset --hard initial &&
|
||||
test_commit "change-a-b-same-B" "initial-file" "AAA" &&
|
||||
git merge-tree initial change-a-b-same-A change-a-b-same-B >actual &&
|
||||
test_cmp expected actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'file change A, B (different)' '
|
||||
@ -175,16 +163,13 @@ AAA" &&
|
||||
'
|
||||
|
||||
test_expect_success 'file remove A, !B' '
|
||||
cat >expected <<\EXPECTED &&
|
||||
EXPECTED
|
||||
|
||||
git reset --hard initial &&
|
||||
test_commit "rm-a-not-b-base" "ONE" "AAA" &&
|
||||
git rm ONE &&
|
||||
git commit -m "rm-a-not-b" &&
|
||||
git tag "rm-a-not-b" &&
|
||||
git merge-tree rm-a-not-b-base rm-a-not-b rm-a-not-b-base >actual &&
|
||||
test_cmp expected actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'file remove !A, B' '
|
||||
@ -206,16 +191,13 @@ EXPECTED
|
||||
'
|
||||
|
||||
test_expect_success 'file remove A, B (same)' '
|
||||
cat >expected <<\EXPECTED &&
|
||||
EXPECTED
|
||||
|
||||
git reset --hard initial &&
|
||||
test_commit "rm-a-b-base" "ONE" "AAA" &&
|
||||
git rm ONE &&
|
||||
git commit -m "rm-a-b" &&
|
||||
git tag "rm-a-b" &&
|
||||
git merge-tree rm-a-b-base rm-a-b rm-a-b >actual &&
|
||||
test_cmp expected actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'file change A, remove B' '
|
||||
@ -260,13 +242,11 @@ EXPECTED
|
||||
'
|
||||
|
||||
test_expect_success 'tree add A, B (same)' '
|
||||
cat >expect <<-\EOF &&
|
||||
EOF
|
||||
git reset --hard initial &&
|
||||
mkdir sub &&
|
||||
test_commit "add sub/file" "sub/file" "file" add-tree-A &&
|
||||
git merge-tree initial add-tree-A add-tree-A >actual &&
|
||||
test_cmp expect actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'tree add A, B (different)' '
|
||||
|
@ -112,8 +112,7 @@ test_expect_success 'prune: do not prune detached HEAD with no reflog' '
|
||||
# (should be removed and disabled by previous test)
|
||||
test_path_is_missing .git/logs &&
|
||||
git prune -n >prune_actual &&
|
||||
: >prune_expected &&
|
||||
test_cmp prune_actual prune_expected
|
||||
test_must_be_empty prune_actual
|
||||
|
||||
'
|
||||
|
||||
|
@ -98,9 +98,8 @@ test_expect_success 'repack' '
|
||||
# We first want to check that we do not have any internal errors,
|
||||
# and also that we do not hit the last-ditch cycle-breaking code
|
||||
# in write_object(), which will issue a warning to stderr.
|
||||
>expect &&
|
||||
git repack -ad 2>stderr &&
|
||||
test_cmp expect stderr &&
|
||||
test_must_be_empty stderr &&
|
||||
|
||||
# And then double-check that the resulting pack is usable (i.e.,
|
||||
# we did not fail to notice any cycles). We know we are accessing
|
||||
|
@ -104,17 +104,17 @@ test_expect_success 'post-update hook arguments' '
|
||||
'
|
||||
|
||||
test_expect_success 'all hook stdin is /dev/null' '
|
||||
! test -s victim.git/update.stdin &&
|
||||
! test -s victim.git/post-update.stdin
|
||||
test_must_be_empty victim.git/update.stdin &&
|
||||
test_must_be_empty victim.git/post-update.stdin
|
||||
'
|
||||
|
||||
test_expect_success 'all *-receive hook args are empty' '
|
||||
! test -s victim.git/pre-receive.args &&
|
||||
! test -s victim.git/post-receive.args
|
||||
test_must_be_empty victim.git/pre-receive.args &&
|
||||
test_must_be_empty victim.git/post-receive.args
|
||||
'
|
||||
|
||||
test_expect_success 'send-pack produced no output' '
|
||||
! test -s send.out
|
||||
test_must_be_empty send.out
|
||||
'
|
||||
|
||||
cat <<EOF >expect
|
||||
|
@ -161,7 +161,7 @@ test_expect_success 'clone shallow object count' '
|
||||
test_expect_success 'clone shallow object count (part 2)' '
|
||||
sed -e "/^in-pack:/d" -e "/^packs:/d" -e "/^size-pack:/d" \
|
||||
-e "/: 0$/d" count.shallow > count_output &&
|
||||
! test -s count_output
|
||||
test_must_be_empty count_output
|
||||
'
|
||||
|
||||
test_expect_success 'fsck in shallow repo' '
|
||||
|
@ -44,7 +44,7 @@ test_expect_success 'pushing into a repository using a ref namespace' '
|
||||
test_cmp expected actual &&
|
||||
# Try a namespace with no content
|
||||
git ls-remote "ext::git --namespace=garbage %s ../pushee" >actual &&
|
||||
test_cmp /dev/null actual &&
|
||||
test_must_be_empty actual &&
|
||||
git ls-remote pushee-unnamespaced >actual &&
|
||||
sed -e "s|refs/|refs/namespaces/namespace/refs/|" expected >expected.unnamespaced &&
|
||||
test_cmp expected.unnamespaced actual
|
||||
|
@ -113,7 +113,7 @@ test_expect_success TTY 'quiet push' '
|
||||
ensure_fresh_upstream &&
|
||||
|
||||
test_terminal git push --quiet --no-progress upstream master 2>&1 | tee output &&
|
||||
test_cmp /dev/null output
|
||||
test_must_be_empty output
|
||||
'
|
||||
|
||||
test_done
|
||||
|
@ -98,8 +98,8 @@ test_expect_success "fetch alone only fetches superproject" '
|
||||
cd downstream &&
|
||||
git fetch >../actual.out 2>../actual.err
|
||||
) &&
|
||||
! test -s actual.out &&
|
||||
! test -s actual.err
|
||||
test_must_be_empty actual.out &&
|
||||
test_must_be_empty actual.err
|
||||
'
|
||||
|
||||
test_expect_success "fetch --no-recurse-submodules only fetches superproject" '
|
||||
@ -107,8 +107,8 @@ test_expect_success "fetch --no-recurse-submodules only fetches superproject" '
|
||||
cd downstream &&
|
||||
git fetch --no-recurse-submodules >../actual.out 2>../actual.err
|
||||
) &&
|
||||
! test -s actual.out &&
|
||||
! test -s actual.err
|
||||
test_must_be_empty actual.out &&
|
||||
test_must_be_empty actual.err
|
||||
'
|
||||
|
||||
test_expect_success "using fetchRecurseSubmodules=true in .gitmodules recurses into submodules" '
|
||||
@ -127,8 +127,8 @@ test_expect_success "--no-recurse-submodules overrides .gitmodules config" '
|
||||
cd downstream &&
|
||||
git fetch --no-recurse-submodules >../actual.out 2>../actual.err
|
||||
) &&
|
||||
! test -s actual.out &&
|
||||
! test -s actual.err
|
||||
test_must_be_empty actual.out &&
|
||||
test_must_be_empty actual.err
|
||||
'
|
||||
|
||||
test_expect_success "using fetchRecurseSubmodules=false in .git/config overrides setting in .gitmodules" '
|
||||
@ -137,8 +137,8 @@ test_expect_success "using fetchRecurseSubmodules=false in .git/config overrides
|
||||
git config submodule.submodule.fetchRecurseSubmodules false &&
|
||||
git fetch >../actual.out 2>../actual.err
|
||||
) &&
|
||||
! test -s actual.out &&
|
||||
! test -s actual.err
|
||||
test_must_be_empty actual.out &&
|
||||
test_must_be_empty actual.err
|
||||
'
|
||||
|
||||
test_expect_success "--recurse-submodules overrides fetchRecurseSubmodules setting from .git/config" '
|
||||
@ -157,8 +157,8 @@ test_expect_success "--quiet propagates to submodules" '
|
||||
cd downstream &&
|
||||
git fetch --recurse-submodules --quiet >../actual.out 2>../actual.err
|
||||
) &&
|
||||
! test -s actual.out &&
|
||||
! test -s actual.err
|
||||
test_must_be_empty actual.out &&
|
||||
test_must_be_empty actual.err
|
||||
'
|
||||
|
||||
test_expect_success "--quiet propagates to parallel submodules" '
|
||||
@ -166,8 +166,8 @@ test_expect_success "--quiet propagates to parallel submodules" '
|
||||
cd downstream &&
|
||||
git fetch --recurse-submodules -j 2 --quiet >../actual.out 2>../actual.err
|
||||
) &&
|
||||
! test -s actual.out &&
|
||||
! test -s actual.err
|
||||
test_must_be_empty actual.out &&
|
||||
test_must_be_empty actual.err
|
||||
'
|
||||
|
||||
test_expect_success "--dry-run propagates to submodules" '
|
||||
@ -221,8 +221,8 @@ test_expect_success "--no-recurse-submodules overrides config setting" '
|
||||
git config fetch.recurseSubmodules true &&
|
||||
git fetch --no-recurse-submodules >../actual.out 2>../actual.err
|
||||
) &&
|
||||
! test -s actual.out &&
|
||||
! test -s actual.err
|
||||
test_must_be_empty actual.out &&
|
||||
test_must_be_empty actual.err
|
||||
'
|
||||
|
||||
test_expect_success "Recursion doesn't happen when no new commits are fetched in the superproject" '
|
||||
@ -235,8 +235,8 @@ test_expect_success "Recursion doesn't happen when no new commits are fetched in
|
||||
git config --unset fetch.recurseSubmodules &&
|
||||
git fetch >../actual.out 2>../actual.err
|
||||
) &&
|
||||
! test -s actual.out &&
|
||||
! test -s actual.err
|
||||
test_must_be_empty actual.out &&
|
||||
test_must_be_empty actual.err
|
||||
'
|
||||
|
||||
test_expect_success "Recursion stops when no new submodule commits are fetched" '
|
||||
@ -268,7 +268,7 @@ test_expect_success "Recursion doesn't happen when new superproject commits don'
|
||||
cd downstream &&
|
||||
git fetch >../actual.out 2>../actual.err
|
||||
) &&
|
||||
! test -s actual.out &&
|
||||
test_must_be_empty actual.out &&
|
||||
test_i18ncmp expect.err.file actual.err
|
||||
'
|
||||
|
||||
@ -357,8 +357,8 @@ test_expect_success "'--recurse-submodules=on-demand' doesn't recurse when no ne
|
||||
git fetch --recurse-submodules=on-demand >../actual.out 2>../actual.err &&
|
||||
git config --unset fetch.recurseSubmodules
|
||||
) &&
|
||||
! test -s actual.out &&
|
||||
! test -s actual.err
|
||||
test_must_be_empty actual.out &&
|
||||
test_must_be_empty actual.err
|
||||
'
|
||||
|
||||
test_expect_success "'--recurse-submodules=on-demand' recurses as deep as necessary (and ignores config)" '
|
||||
@ -402,7 +402,7 @@ test_expect_success "'--recurse-submodules=on-demand' stops when no new submodul
|
||||
cd downstream &&
|
||||
git fetch --recurse-submodules=on-demand >../actual.out 2>../actual.err
|
||||
) &&
|
||||
! test -s actual.out &&
|
||||
test_must_be_empty actual.out &&
|
||||
test_i18ncmp expect.err.file actual.err
|
||||
'
|
||||
|
||||
@ -477,7 +477,7 @@ test_expect_success "don't fetch submodule when newly recorded commits are alrea
|
||||
cd downstream &&
|
||||
git fetch >../actual.out 2>../actual.err
|
||||
) &&
|
||||
! test -s actual.out &&
|
||||
test_must_be_empty actual.out &&
|
||||
test_i18ncmp expect.err actual.err &&
|
||||
(
|
||||
cd submodule &&
|
||||
@ -495,7 +495,6 @@ test_expect_success "'fetch.recurseSubmodules=on-demand' works also without .git
|
||||
git add submodule &&
|
||||
git rm .gitmodules &&
|
||||
git commit -m "new submodule without .gitmodules" &&
|
||||
printf "" >expect.out &&
|
||||
head2=$(git rev-parse --short HEAD) &&
|
||||
echo "From $pwd/." >expect.err.2 &&
|
||||
echo " $head1..$head2 master -> origin/master" >>expect.err.2 &&
|
||||
@ -514,7 +513,7 @@ test_expect_success "'fetch.recurseSubmodules=on-demand' works also without .git
|
||||
git config --unset fetch.recurseSubmodules &&
|
||||
git reset --hard
|
||||
) &&
|
||||
test_i18ncmp expect.out actual.out &&
|
||||
test_must_be_empty actual.out &&
|
||||
test_i18ncmp expect.err.2 actual.err &&
|
||||
git checkout HEAD^ -- .gitmodules &&
|
||||
git add .gitmodules &&
|
||||
|
@ -210,7 +210,7 @@ test_expect_success TTY 'push --quiet silences status and progress' '
|
||||
cd "$ROOT_PATH"/test_repo_clone &&
|
||||
test_commit quiet &&
|
||||
test_terminal git push --quiet >output 2>&1 &&
|
||||
test_cmp /dev/null output
|
||||
test_must_be_empty output
|
||||
'
|
||||
|
||||
test_expect_success TTY 'push --no-progress silences progress but not status' '
|
||||
|
@ -51,7 +51,7 @@ test_expect_success 'no-op fetch -v stderr is as expected' '
|
||||
|
||||
test_expect_success 'no-op fetch without "-v" is quiet' '
|
||||
(cd clone && git fetch 2>../stderr) &&
|
||||
! test -s stderr
|
||||
test_must_be_empty stderr
|
||||
'
|
||||
|
||||
test_expect_success 'remote detects correct HEAD' '
|
||||
|
@ -256,7 +256,7 @@ test_expect_success 'rev-list accumulates multiple --exclude' '
|
||||
'
|
||||
|
||||
test_expect_failure 'rev-list should succeed with empty output on empty stdin' '
|
||||
git rev-list --stdin <expect >actual &&
|
||||
git rev-list --stdin </dev/null >actual &&
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
|
@ -113,12 +113,11 @@ test_expect_success 'verify blob:limit=1k' '
|
||||
'
|
||||
|
||||
test_expect_success 'verify blob:limit=1m' '
|
||||
cat </dev/null >expected &&
|
||||
git -C r2 rev-list HEAD --quiet --objects --filter-print-omitted --filter=blob:limit=1m \
|
||||
| awk -f print_1.awk \
|
||||
| sed "s/~//" \
|
||||
| sort >observed &&
|
||||
test_cmp observed expected
|
||||
test_must_be_empty observed
|
||||
'
|
||||
|
||||
# Test sparse:path=<path> filter.
|
||||
|
@ -121,10 +121,9 @@ test_expect_success 'describe --contains defaults to HEAD without commit-ish' '
|
||||
test_cmp expect actual
|
||||
'
|
||||
|
||||
: >err.expect
|
||||
check_describe tags/A --all A^0
|
||||
test_expect_success 'no warning was displayed for A' '
|
||||
test_cmp err.expect err.actual
|
||||
test_must_be_empty err.actual
|
||||
'
|
||||
|
||||
test_expect_success 'rename tag A to Q locally' '
|
||||
|
@ -97,9 +97,8 @@ test_expect_success 'no-glob option matches literally (bracket)' '
|
||||
'
|
||||
|
||||
test_expect_success 'no-glob option disables :(literal)' '
|
||||
: >expect &&
|
||||
git --literal-pathspecs log --format=%s -- ":(literal)foo" >actual &&
|
||||
test_cmp expect actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'no-glob environment variable works' '
|
||||
@ -130,9 +129,8 @@ test_expect_success '**/ works with :(glob)' '
|
||||
'
|
||||
|
||||
test_expect_success '**/ does not work with --noglob-pathspecs' '
|
||||
: >expect &&
|
||||
git --noglob-pathspecs log --format=%s -- "**/bar" >actual &&
|
||||
test_cmp expect actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success '**/ works with :(glob) and --noglob-pathspecs' '
|
||||
@ -154,9 +152,8 @@ test_expect_success '**/ works with --glob-pathspecs' '
|
||||
'
|
||||
|
||||
test_expect_success '**/ does not work with :(literal) and --glob-pathspecs' '
|
||||
: >expect &&
|
||||
git --glob-pathspecs log --format=%s -- ":(literal)**/bar" >actual &&
|
||||
test_cmp expect actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_done
|
||||
|
@ -366,8 +366,6 @@ test_expect_success 'merge-msg with nothing to merge' '
|
||||
test_unconfig merge.log &&
|
||||
test_config merge.summary yes &&
|
||||
|
||||
>empty &&
|
||||
|
||||
(
|
||||
cd remote &&
|
||||
git checkout -b unrelated &&
|
||||
@ -376,7 +374,7 @@ test_expect_success 'merge-msg with nothing to merge' '
|
||||
git fmt-merge-msg <.git/FETCH_HEAD >../actual
|
||||
) &&
|
||||
|
||||
test_cmp empty actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'merge-msg tag' '
|
||||
|
@ -384,7 +384,7 @@ test_expect_success 'mv does not complain when no .gitmodules file is found' '
|
||||
entry="$(git ls-files --stage sub | cut -f 1)" &&
|
||||
mkdir mod &&
|
||||
git mv sub mod/sub 2>actual.err &&
|
||||
! test -s actual.err &&
|
||||
test_must_be_empty actual.err &&
|
||||
! test -e sub &&
|
||||
[ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&
|
||||
(
|
||||
@ -408,7 +408,7 @@ test_expect_success 'mv will error out on a modified .gitmodules file unless sta
|
||||
git diff-files --quiet -- sub &&
|
||||
git add .gitmodules &&
|
||||
git mv sub mod/sub 2>actual.err &&
|
||||
! test -s actual.err &&
|
||||
test_must_be_empty actual.err &&
|
||||
! test -e sub &&
|
||||
[ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&
|
||||
(
|
||||
@ -469,7 +469,7 @@ test_expect_success 'checking out a commit before submodule moved needs manual u
|
||||
git update-index --refresh &&
|
||||
git diff-files --quiet -- sub .gitmodules &&
|
||||
git status -s sub2 >actual &&
|
||||
! test -s actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'mv -k does not accidentally destroy submodules' '
|
||||
|
@ -325,11 +325,10 @@ test_expect_success \
|
||||
test_cmp expect actual
|
||||
'
|
||||
|
||||
>expect
|
||||
test_expect_success \
|
||||
'listing tags using v.* should print nothing because none have v.' '
|
||||
git tag -l "v.*" > actual &&
|
||||
test_cmp expect actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
cat >expect <<EOF
|
||||
@ -1511,12 +1510,9 @@ test_expect_success 'inverse of the last test, with --no-contains' "
|
||||
test_cmp expected actual
|
||||
"
|
||||
|
||||
cat > expected <<EOF
|
||||
EOF
|
||||
|
||||
test_expect_success 'checking that third commit has no tags' "
|
||||
git tag -l --contains $hash3 v* >actual &&
|
||||
test_cmp expected actual
|
||||
test_must_be_empty actual
|
||||
"
|
||||
|
||||
cat > expected <<EOF
|
||||
|
@ -57,9 +57,8 @@ test_expect_success 'git grep -ah ina a' '
|
||||
'
|
||||
|
||||
test_expect_success 'git grep -I ina a' '
|
||||
: >expect &&
|
||||
test_must_fail git grep -I ina a >actual &&
|
||||
test_cmp expect actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'git grep -c ina a' '
|
||||
@ -81,9 +80,8 @@ test_expect_success 'git grep -L bar a' '
|
||||
'
|
||||
|
||||
test_expect_success 'git grep -q ina a' '
|
||||
: >expect &&
|
||||
git grep -q ina a >actual &&
|
||||
test_cmp expect actual
|
||||
test_must_be_empty actual
|
||||
'
|
||||
|
||||
test_expect_success 'git grep -F ile a' '
|
||||
|
@ -364,11 +364,8 @@ test_expect_success 'verify upstream fields in branch header' '
|
||||
test_cmp expect actual &&
|
||||
|
||||
## Repeat the above but without --branch.
|
||||
cat >expect <<-EOF &&
|
||||
EOF
|
||||
|
||||
git status --porcelain=v2 --untracked-files=all >actual &&
|
||||
test_cmp expect actual &&
|
||||
test_must_be_empty actual &&
|
||||
|
||||
## Test upstream-gone case. Fake this by pointing origin/master at
|
||||
## a non-existing commit.
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user