Merge branch 'fc/trivial'
* fc/trivial: pull: use $curr_branch_short more add: trivial style cleanup reset: trivial style cleanup branch: trivial style fix reset: trivial refactoring
This commit is contained in:
commit
c8ccfc9cdf
2
branch.c
2
branch.c
@ -307,7 +307,7 @@ void create_branch(const char *head,
|
|||||||
start_name);
|
start_name);
|
||||||
|
|
||||||
if (real_ref && track)
|
if (real_ref && track)
|
||||||
setup_tracking(ref.buf+11, real_ref, track, quiet);
|
setup_tracking(ref.buf + 11, real_ref, track, quiet);
|
||||||
|
|
||||||
if (!dont_change_ref)
|
if (!dont_change_ref)
|
||||||
if (write_ref_sha1(lock, sha1, msg) < 0)
|
if (write_ref_sha1(lock, sha1, msg) < 0)
|
||||||
|
@ -296,7 +296,7 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
|
|||||||
git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
|
git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
|
||||||
|
|
||||||
if (read_cache() < 0)
|
if (read_cache() < 0)
|
||||||
die (_("Could not read the index"));
|
die(_("Could not read the index"));
|
||||||
|
|
||||||
init_revisions(&rev, prefix);
|
init_revisions(&rev, prefix);
|
||||||
rev.diffopt.context = 7;
|
rev.diffopt.context = 7;
|
||||||
@ -307,11 +307,11 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
|
|||||||
DIFF_OPT_SET(&rev.diffopt, IGNORE_DIRTY_SUBMODULES);
|
DIFF_OPT_SET(&rev.diffopt, IGNORE_DIRTY_SUBMODULES);
|
||||||
out = open(file, O_CREAT | O_WRONLY, 0666);
|
out = open(file, O_CREAT | O_WRONLY, 0666);
|
||||||
if (out < 0)
|
if (out < 0)
|
||||||
die (_("Could not open '%s' for writing."), file);
|
die(_("Could not open '%s' for writing."), file);
|
||||||
rev.diffopt.file = xfdopen(out, "w");
|
rev.diffopt.file = xfdopen(out, "w");
|
||||||
rev.diffopt.close_file = 1;
|
rev.diffopt.close_file = 1;
|
||||||
if (run_diff_files(&rev, 0))
|
if (run_diff_files(&rev, 0))
|
||||||
die (_("Could not write patch"));
|
die(_("Could not write patch"));
|
||||||
|
|
||||||
launch_editor(file, NULL, NULL);
|
launch_editor(file, NULL, NULL);
|
||||||
|
|
||||||
@ -324,7 +324,7 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
|
|||||||
child.git_cmd = 1;
|
child.git_cmd = 1;
|
||||||
child.argv = apply_argv;
|
child.argv = apply_argv;
|
||||||
if (run_command(&child))
|
if (run_command(&child))
|
||||||
die (_("Could not apply '%s'"), file);
|
die(_("Could not apply '%s'"), file);
|
||||||
|
|
||||||
unlink(file);
|
unlink(file);
|
||||||
free(file);
|
free(file);
|
||||||
@ -582,7 +582,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
|
|||||||
|
|
||||||
unplug_bulk_checkin();
|
unplug_bulk_checkin();
|
||||||
|
|
||||||
finish:
|
finish:
|
||||||
if (active_cache_changed) {
|
if (active_cache_changed) {
|
||||||
if (write_cache(newfd, active_cache, active_nr) ||
|
if (write_cache(newfd, active_cache, active_nr) ||
|
||||||
commit_locked_index(&lock_file))
|
commit_locked_index(&lock_file))
|
||||||
|
@ -330,11 +330,14 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
|
|||||||
die_if_unmerged_cache(reset_type);
|
die_if_unmerged_cache(reset_type);
|
||||||
|
|
||||||
if (reset_type != SOFT) {
|
if (reset_type != SOFT) {
|
||||||
struct lock_file *lock = xcalloc(1, sizeof(struct lock_file));
|
struct lock_file *lock = xcalloc(1, sizeof(*lock));
|
||||||
int newfd = hold_locked_index(lock, 1);
|
int newfd = hold_locked_index(lock, 1);
|
||||||
if (reset_type == MIXED) {
|
if (reset_type == MIXED) {
|
||||||
|
int flags = quiet ? REFRESH_QUIET : REFRESH_IN_PORCELAIN;
|
||||||
if (read_from_tree(&pathspec, sha1))
|
if (read_from_tree(&pathspec, sha1))
|
||||||
return 1;
|
return 1;
|
||||||
|
refresh_index(&the_index, flags, NULL, NULL,
|
||||||
|
_("Unstaged changes after reset:"));
|
||||||
} else {
|
} else {
|
||||||
int err = reset_index(sha1, reset_type, quiet);
|
int err = reset_index(sha1, reset_type, quiet);
|
||||||
if (reset_type == KEEP && !err)
|
if (reset_type == KEEP && !err)
|
||||||
@ -343,12 +346,6 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
|
|||||||
die(_("Could not reset index file to revision '%s'."), rev);
|
die(_("Could not reset index file to revision '%s'."), rev);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reset_type == MIXED) { /* Report what has not been updated. */
|
|
||||||
int flags = quiet ? REFRESH_QUIET : REFRESH_IN_PORCELAIN;
|
|
||||||
refresh_index(&the_index, flags, NULL, NULL,
|
|
||||||
_("Unstaged changes after reset:"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (write_cache(newfd, active_cache, active_nr) ||
|
if (write_cache(newfd, active_cache, active_nr) ||
|
||||||
commit_locked_index(lock))
|
commit_locked_index(lock))
|
||||||
die(_("Could not write new index file."));
|
die(_("Could not write new index file."));
|
||||||
|
@ -187,9 +187,8 @@ error_on_no_merge_candidates () {
|
|||||||
op_prep=with
|
op_prep=with
|
||||||
fi
|
fi
|
||||||
|
|
||||||
curr_branch=${curr_branch#refs/heads/}
|
upstream=$(git config "branch.$curr_branch_short.merge")
|
||||||
upstream=$(git config "branch.$curr_branch.merge")
|
remote=$(git config "branch.$curr_branch_short.remote")
|
||||||
remote=$(git config "branch.$curr_branch.remote")
|
|
||||||
|
|
||||||
if [ $# -gt 1 ]; then
|
if [ $# -gt 1 ]; then
|
||||||
if [ "$rebase" = true ]; then
|
if [ "$rebase" = true ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user