diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2008-09-25 19:27:53 +0400 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2008-09-25 19:27:53 +0400 |
commit | c9c6cc8d7db312b9e8502f8d55422b8309cde2f3 (patch) | |
tree | f13048eaaa0dd450171d2bce68ebe17e7c3a1847 | |
parent | baede9f803ff7becab815481b004bc983d0422c7 (diff) | |
parent | 93feb4bb14dbd5c89701d6f2b0ab3d83dbc999c5 (diff) |
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
-rw-r--r-- | Documentation/RelNotes-1.6.0.3.txt | 18 | ||||
-rw-r--r-- | builtin-checkout.c | 2 | ||||
-rw-r--r-- | builtin-for-each-ref.c | 4 | ||||
-rw-r--r-- | builtin-merge.c | 2 | ||||
-rwxr-xr-x | git-stash.sh | 17 | ||||
-rw-r--r-- | git.c | 2 | ||||
-rwxr-xr-x | t/t1300-repo-config.sh | 10 |
7 files changed, 49 insertions, 6 deletions
diff --git a/Documentation/RelNotes-1.6.0.3.txt b/Documentation/RelNotes-1.6.0.3.txt index ea1420d77a..46e13a450a 100644 --- a/Documentation/RelNotes-1.6.0.3.txt +++ b/Documentation/RelNotes-1.6.0.3.txt @@ -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 diff --git a/builtin-checkout.c b/builtin-checkout.c index 4497b7092d..9a0c173c14 100644 --- a/builtin-checkout.c +++ b/builtin-checkout.c @@ -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; diff --git a/builtin-for-each-ref.c b/builtin-for-each-ref.c index 9b44092671..e59bd8075e 100644 --- a/builtin-for-each-ref.c +++ b/builtin-for-each-ref.c @@ -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); } diff --git a/builtin-merge.c b/builtin-merge.c index 9ad9791068..1094c5fd58 100644 --- a/builtin-merge.c +++ b/builtin-merge.c @@ -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++; diff --git a/git-stash.sh b/git-stash.sh index d799c76378..6bd2572f77 100755 --- a/git-stash.sh +++ b/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:") || @@ -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" diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh index 64567fb94d..11b82f43dd 100755 --- a/t/t1300-repo-config.sh +++ b/t/t1300-repo-config.sh @@ -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 |