Merge branch 'maint'
* maint: Update release notes for 1.6.0.3 checkout: Do not show local changes when in quiet mode for-each-ref: Fix --format=%(subject) for log message without newlines git-stash.sh: don't default to refs/stash if invalid ref supplied maint: check return of split_cmdline to avoid bad config strings
This commit is contained in:
commit
c9c6cc8d7d
@ -16,6 +16,22 @@ Fixes since v1.6.0.2
|
||||
* Behaviour of "git diff --quiet" was inconsistent with "diff --exit-code"
|
||||
with the output redirected to /dev/null.
|
||||
|
||||
* "git stash apply sash@{1}" was fixed to error out. Prior versions
|
||||
would have applied stash@{0} incorrectly.
|
||||
|
||||
* "git for-each-ref --format=%(subject)" fixed for commits with no
|
||||
no newline in the message body.
|
||||
|
||||
* "git remote" fixed to protect printf from user input.
|
||||
|
||||
* "git checkout -q" once again suppresses the locally modified file list.
|
||||
|
||||
* Cross-directory renames are no longer used when creating packs. This
|
||||
allows more graceful behavior on filesystems like sshfs.
|
||||
|
||||
* Stale temporary files under $GIT_DIR/objects/pack are now cleaned up
|
||||
automatically by "git prune".
|
||||
|
||||
* "Git.pm" tests relied on unnecessarily more recent version of Perl.
|
||||
|
||||
* "gitweb" triggered undef warning on commits without log messages.
|
||||
@ -24,6 +40,6 @@ Many other documentation updates.
|
||||
|
||||
--
|
||||
exec >/var/tmp/1
|
||||
O=v1.6.0.2-32-g8d11fde
|
||||
O=v1.6.0.2-41-g7fe4a72
|
||||
echo O=$(git describe maint)
|
||||
git shortlog --no-merges $O..maint
|
||||
|
@ -328,7 +328,7 @@ static int merge_working_tree(struct checkout_opts *opts,
|
||||
commit_locked_index(lock_file))
|
||||
die("unable to write new index file");
|
||||
|
||||
if (!opts->force)
|
||||
if (!opts->force && !opts->quiet)
|
||||
show_local_changes(&new->commit->object);
|
||||
|
||||
return 0;
|
||||
|
@ -321,8 +321,8 @@ static const char *find_wholine(const char *who, int wholen, const char *buf, un
|
||||
static const char *copy_line(const char *buf)
|
||||
{
|
||||
const char *eol = strchr(buf, '\n');
|
||||
if (!eol)
|
||||
return "";
|
||||
if (!eol) // simulate strchrnul()
|
||||
eol = buf + strlen(buf);
|
||||
return xmemdupz(buf, eol - buf);
|
||||
}
|
||||
|
||||
|
@ -476,6 +476,8 @@ static int git_merge_config(const char *k, const char *v, void *cb)
|
||||
|
||||
buf = xstrdup(v);
|
||||
argc = split_cmdline(buf, &argv);
|
||||
if (argc < 0)
|
||||
die("Bad branch.%s.mergeoptions string", branch);
|
||||
argv = xrealloc(argv, sizeof(*argv) * (argc + 2));
|
||||
memmove(argv + 1, argv, sizeof(*argv) * (argc + 1));
|
||||
argc++;
|
||||
|
17
git-stash.sh
17
git-stash.sh
@ -144,7 +144,14 @@ show_stash () {
|
||||
then
|
||||
flags=--stat
|
||||
fi
|
||||
s=$(git rev-parse --revs-only --no-flags --default $ref_stash "$@")
|
||||
|
||||
if test $# = 0
|
||||
then
|
||||
set x "$ref_stash@{0}"
|
||||
shift
|
||||
fi
|
||||
|
||||
s=$(git rev-parse --revs-only --no-flags "$@")
|
||||
|
||||
w_commit=$(git rev-parse --verify "$s") &&
|
||||
b_commit=$(git rev-parse --verify "$s^") &&
|
||||
@ -163,13 +170,19 @@ apply_stash () {
|
||||
shift
|
||||
esac
|
||||
|
||||
if test $# = 0
|
||||
then
|
||||
set x "$ref_stash@{0}"
|
||||
shift
|
||||
fi
|
||||
|
||||
# current index state
|
||||
c_tree=$(git write-tree) ||
|
||||
die 'Cannot apply a stash in the middle of a merge'
|
||||
|
||||
# stash records the work tree, and is a merge between the
|
||||
# base commit (first parent) and the index tree (second parent).
|
||||
s=$(git rev-parse --revs-only --no-flags --default $ref_stash "$@") &&
|
||||
s=$(git rev-parse --revs-only --no-flags "$@") &&
|
||||
w_tree=$(git rev-parse --verify "$s:") &&
|
||||
b_tree=$(git rev-parse --verify "$s^1:") &&
|
||||
i_tree=$(git rev-parse --verify "$s^2:") ||
|
||||
|
2
git.c
2
git.c
@ -162,6 +162,8 @@ static int handle_alias(int *argcp, const char ***argv)
|
||||
alias_string + 1, alias_command);
|
||||
}
|
||||
count = split_cmdline(alias_string, &new_argv);
|
||||
if (count < 0)
|
||||
die("Bad alias.%s string", alias_command);
|
||||
option_count = handle_options(&new_argv, &count, &envchanged);
|
||||
if (envchanged)
|
||||
die("alias '%s' changes environment variables\n"
|
||||
|
@ -741,4 +741,14 @@ test_expect_success 'symlinked configuration' '
|
||||
|
||||
'
|
||||
|
||||
test_expect_success 'check split_cmdline return' "
|
||||
git config alias.split-cmdline-fix 'echo \"' &&
|
||||
test_must_fail git split-cmdline-fix &&
|
||||
echo foo > foo &&
|
||||
git add foo &&
|
||||
git commit -m 'initial commit' &&
|
||||
git config branch.master.mergeoptions 'echo \"' &&
|
||||
test_must_fail git merge master
|
||||
"
|
||||
|
||||
test_done
|
||||
|
Loading…
Reference in New Issue
Block a user