зеркало из https://github.com/microsoft/git.git
Merge branch 'maint'
* maint: rebase -i: clarify in-editor documentation of "exec" tests: sanitize more git environment variables fast-import: treat filemodify with empty tree as delete rebase: give a better error message for bogus branch rebase: use explicit "--" with checkout Conflicts: t/t9300-fast-import.sh
This commit is contained in:
Коммит
99e63ef24e
|
@ -2231,6 +2231,12 @@ static void file_change_m(struct branch *b)
|
||||||
p = uq.buf;
|
p = uq.buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Git does not track empty, non-toplevel directories. */
|
||||||
|
if (S_ISDIR(mode) && !memcmp(sha1, EMPTY_TREE_SHA1_BIN, 20) && *p) {
|
||||||
|
tree_content_remove(&b->branch_tree, p, NULL);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (S_ISGITLINK(mode)) {
|
if (S_ISGITLINK(mode)) {
|
||||||
if (inline_data)
|
if (inline_data)
|
||||||
die("Git links cannot be specified 'inline': %s",
|
die("Git links cannot be specified 'inline': %s",
|
||||||
|
|
|
@ -894,7 +894,7 @@ first and then run 'git rebase --continue' again."
|
||||||
|
|
||||||
if test ! -z "$1"
|
if test ! -z "$1"
|
||||||
then
|
then
|
||||||
output git checkout "$1" ||
|
output git checkout "$1" -- ||
|
||||||
die "Could not checkout $1"
|
die "Could not checkout $1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -1021,7 +1021,7 @@ first and then run 'git rebase --continue' again."
|
||||||
# e, edit = use commit, but stop for amending
|
# e, edit = use commit, but stop for amending
|
||||||
# s, squash = use commit, but meld into previous commit
|
# s, squash = use commit, but meld into previous commit
|
||||||
# f, fixup = like "squash", but discard this commit's log message
|
# f, fixup = like "squash", but discard this commit's log message
|
||||||
# x <cmd>, exec <cmd> = Run a shell command <cmd>, and stop if it fails
|
# x, exec = run command (the rest of the line) using shell
|
||||||
#
|
#
|
||||||
# If you remove a line here THAT COMMIT WILL BE LOST.
|
# If you remove a line here THAT COMMIT WILL BE LOST.
|
||||||
# However, if you remove everything, the rebase will be aborted.
|
# However, if you remove everything, the rebase will be aborted.
|
||||||
|
|
|
@ -482,6 +482,7 @@ case "$#" in
|
||||||
then
|
then
|
||||||
head_name="detached HEAD"
|
head_name="detached HEAD"
|
||||||
else
|
else
|
||||||
|
echo >&2 "fatal: no such branch: $1"
|
||||||
usage
|
usage
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
@ -513,7 +514,7 @@ then
|
||||||
if test -z "$force_rebase"
|
if test -z "$force_rebase"
|
||||||
then
|
then
|
||||||
# Lazily switch to the target branch if needed...
|
# Lazily switch to the target branch if needed...
|
||||||
test -z "$switch_to" || git checkout "$switch_to"
|
test -z "$switch_to" || git checkout "$switch_to" --
|
||||||
say "Current branch $branch_name is up to date."
|
say "Current branch $branch_name is up to date."
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
|
|
|
@ -919,6 +919,48 @@ test_expect_success \
|
||||||
git diff-tree -C --find-copies-harder -r N4 N6 >actual &&
|
git diff-tree -C --find-copies-harder -r N4 N6 >actual &&
|
||||||
compare_diff_raw expect actual'
|
compare_diff_raw expect actual'
|
||||||
|
|
||||||
|
test_expect_success \
|
||||||
|
'N: delete directory by copying' \
|
||||||
|
'cat >expect <<-\EOF &&
|
||||||
|
OBJID
|
||||||
|
:100644 000000 OBJID OBJID D foo/bar/qux
|
||||||
|
OBJID
|
||||||
|
:000000 100644 OBJID OBJID A foo/bar/baz
|
||||||
|
:000000 100644 OBJID OBJID A foo/bar/qux
|
||||||
|
EOF
|
||||||
|
empty_tree=$(git mktree </dev/null) &&
|
||||||
|
cat >input <<-INPUT_END &&
|
||||||
|
commit refs/heads/N-delete
|
||||||
|
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
|
||||||
|
data <<COMMIT
|
||||||
|
collect data to be deleted
|
||||||
|
COMMIT
|
||||||
|
|
||||||
|
deleteall
|
||||||
|
M 100644 inline foo/bar/baz
|
||||||
|
data <<DATA_END
|
||||||
|
hello
|
||||||
|
DATA_END
|
||||||
|
C "foo/bar/baz" "foo/bar/qux"
|
||||||
|
C "foo/bar/baz" "foo/bar/quux/1"
|
||||||
|
C "foo/bar/baz" "foo/bar/quuux"
|
||||||
|
M 040000 $empty_tree foo/bar/quux
|
||||||
|
M 040000 $empty_tree foo/bar/quuux
|
||||||
|
|
||||||
|
commit refs/heads/N-delete
|
||||||
|
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
|
||||||
|
data <<COMMIT
|
||||||
|
delete subdirectory
|
||||||
|
COMMIT
|
||||||
|
|
||||||
|
M 040000 $empty_tree foo/bar/qux
|
||||||
|
INPUT_END
|
||||||
|
git fast-import <input &&
|
||||||
|
git rev-list N-delete |
|
||||||
|
git diff-tree -r --stdin --root --always |
|
||||||
|
sed -e "s/$_x40/OBJID/g" >actual &&
|
||||||
|
test_cmp expect actual'
|
||||||
|
|
||||||
test_expect_success \
|
test_expect_success \
|
||||||
'N: modify copied tree' \
|
'N: modify copied tree' \
|
||||||
'cat >expect <<-\EOF &&
|
'cat >expect <<-\EOF &&
|
||||||
|
|
|
@ -70,6 +70,9 @@ unset GIT_NOTES_REF
|
||||||
unset GIT_NOTES_DISPLAY_REF
|
unset GIT_NOTES_DISPLAY_REF
|
||||||
unset GIT_NOTES_REWRITE_REF
|
unset GIT_NOTES_REWRITE_REF
|
||||||
unset GIT_NOTES_REWRITE_MODE
|
unset GIT_NOTES_REWRITE_MODE
|
||||||
|
unset GIT_REFLOG_ACTION
|
||||||
|
unset GIT_CHERRY_PICK_HELP
|
||||||
|
unset GIT_QUIET
|
||||||
GIT_MERGE_VERBOSITY=5
|
GIT_MERGE_VERBOSITY=5
|
||||||
export GIT_MERGE_VERBOSITY
|
export GIT_MERGE_VERBOSITY
|
||||||
export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME
|
export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME
|
||||||
|
|
Загрузка…
Ссылка в новой задаче