mirror of
https://github.com/git/git.git
synced 2026-03-16 19:50:09 +01:00
Merge branch 'master' into next
* master: Git 1.7.8-rc4 builtin-reset: Documentation update builtin-branch: Fix crash on invalid use of --force revert --abort: do not leave behind useless sequencer-old directory Fix revert --abort on Windows revert: do not pass non-literal string as format to git_path() Conflicts: builtin/branch.c
This commit is contained in:
@@ -162,7 +162,7 @@ included in this release.
|
||||
|
||||
---
|
||||
exec >/var/tmp/1
|
||||
O=v1.7.8-rc3-16-g9e9ab40
|
||||
O=v1.7.8-rc4
|
||||
echo O=$(git describe --always master)
|
||||
git log --first-parent --oneline --reverse ^$O master
|
||||
echo
|
||||
|
||||
@@ -9,8 +9,8 @@ SYNOPSIS
|
||||
--------
|
||||
[verse]
|
||||
'git reset' [-q] [<commit>] [--] <paths>...
|
||||
'git reset' [--patch|-p] [<commit>] [--] [<paths>...]
|
||||
'git reset' [--soft | --mixed | --hard | --merge | --keep] [-q] [<commit>]
|
||||
'git reset' (--patch | -p) [<commit>] [--] [<paths>...]
|
||||
'git reset' (--soft | --mixed | --hard | --merge | --keep) [-q] [<commit>]
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
@@ -34,7 +34,7 @@ Alternatively, using linkgit:git-checkout[1] and specifying a commit, you
|
||||
can copy the contents of a path out of a commit to the index and to the
|
||||
working tree in one go.
|
||||
|
||||
'git reset' --patch|-p [<commit>] [--] [<paths>...]::
|
||||
'git reset' (--patch | -p) [<commit>] [--] [<paths>...]::
|
||||
Interactively select hunks in the difference between the index
|
||||
and <commit> (defaults to HEAD). The chosen hunks are applied
|
||||
in reverse to the index.
|
||||
@@ -43,7 +43,7 @@ This means that `git reset -p` is the opposite of `git add -p`, i.e.
|
||||
you can use it to selectively reset hunks. See the ``Interactive Mode''
|
||||
section of linkgit:git-add[1] to learn how to operate the `\--patch` mode.
|
||||
|
||||
'git reset' [--<mode>] [<commit>]::
|
||||
'git reset' --<mode> [<commit>]::
|
||||
This form resets the current branch head to <commit> and
|
||||
possibly updates the index (resetting it to the tree of <commit>) and
|
||||
the working tree depending on <mode>, which
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
GVF=GIT-VERSION-FILE
|
||||
DEF_VER=v1.7.8-rc3
|
||||
DEF_VER=v1.7.8-rc4
|
||||
|
||||
LF='
|
||||
'
|
||||
|
||||
@@ -747,7 +747,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
|
||||
argc = parse_options(argc, argv, prefix, options, builtin_branch_usage,
|
||||
0);
|
||||
|
||||
if (!delete && !rename && !force_create && !edit_description && argc == 0)
|
||||
if (!delete && !rename && !edit_description && argc == 0)
|
||||
list = 1;
|
||||
|
||||
if (!!delete + !!rename + !!force_create + !!list > 1)
|
||||
@@ -780,7 +780,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
|
||||
rename_branch(argv[0], argv[1], rename > 1);
|
||||
else
|
||||
usage_with_options(builtin_branch_usage, options);
|
||||
} else if (argc <= 2) {
|
||||
} else if (argc > 0 && argc <= 2) {
|
||||
if (kinds != REF_LOCAL_BRANCH)
|
||||
die(_("-a and -r options to 'git branch' do not make sense with a branch name"));
|
||||
create_branch(head, argv[0], (argc == 2) ? argv[1] : head,
|
||||
|
||||
@@ -318,7 +318,7 @@ static void write_cherry_pick_head(struct commit *commit, const char *pseudoref)
|
||||
|
||||
strbuf_addf(&buf, "%s\n", sha1_to_hex(commit->object.sha1));
|
||||
|
||||
filename = git_path(pseudoref);
|
||||
filename = git_path("%s", pseudoref);
|
||||
fd = open(filename, O_WRONLY | O_CREAT, 0666);
|
||||
if (fd < 0)
|
||||
die_errno(_("Could not open '%s' for writing"), filename);
|
||||
@@ -924,8 +924,10 @@ static int sequencer_rollback(struct replay_opts *opts)
|
||||
if (strbuf_getline(&buf, f, '\n')) {
|
||||
error(_("cannot read %s: %s"), filename, ferror(f) ?
|
||||
strerror(errno) : _("unexpected end of file"));
|
||||
fclose(f);
|
||||
goto fail;
|
||||
}
|
||||
fclose(f);
|
||||
if (get_sha1_hex(buf.buf, sha1) || buf.buf[40] != '\0') {
|
||||
error(_("stored pre-cherry-pick HEAD file '%s' is corrupt"),
|
||||
filename);
|
||||
@@ -933,12 +935,11 @@ static int sequencer_rollback(struct replay_opts *opts)
|
||||
}
|
||||
if (reset_for_rollback(sha1))
|
||||
goto fail;
|
||||
remove_sequencer_state(1);
|
||||
strbuf_release(&buf);
|
||||
fclose(f);
|
||||
return 0;
|
||||
fail:
|
||||
strbuf_release(&buf);
|
||||
fclose(f);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,4 +41,12 @@ test_expect_success 'reset --hard cleans up sequencer state, providing one-level
|
||||
test_path_is_missing .git/sequencer-old
|
||||
'
|
||||
|
||||
test_expect_success 'cherry-pick --abort does not leave sequencer-old dir' '
|
||||
pristine_detach initial &&
|
||||
test_must_fail git cherry-pick base..anotherpick &&
|
||||
git cherry-pick --abort &&
|
||||
test_path_is_missing .git/sequencer &&
|
||||
test_path_is_missing .git/sequencer-old
|
||||
'
|
||||
|
||||
test_done
|
||||
|
||||
Reference in New Issue
Block a user