Skip to content

Commit c8ccfc9

Browse files
committed
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
2 parents 984ac91 + b07f729 commit c8ccfc9

File tree

4 files changed

+12
-16
lines changed

4 files changed

+12
-16
lines changed

branch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ void create_branch(const char *head,
307307
start_name);
308308

309309
if (real_ref && track)
310-
setup_tracking(ref.buf+11, real_ref, track, quiet);
310+
setup_tracking(ref.buf + 11, real_ref, track, quiet);
311311

312312
if (!dont_change_ref)
313313
if (write_ref_sha1(lock, sha1, msg) < 0)

builtin/add.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
296296
git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
297297

298298
if (read_cache() < 0)
299-
die (_("Could not read the index"));
299+
die(_("Could not read the index"));
300300

301301
init_revisions(&rev, prefix);
302302
rev.diffopt.context = 7;
@@ -307,11 +307,11 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
307307
DIFF_OPT_SET(&rev.diffopt, IGNORE_DIRTY_SUBMODULES);
308308
out = open(file, O_CREAT | O_WRONLY, 0666);
309309
if (out < 0)
310-
die (_("Could not open '%s' for writing."), file);
310+
die(_("Could not open '%s' for writing."), file);
311311
rev.diffopt.file = xfdopen(out, "w");
312312
rev.diffopt.close_file = 1;
313313
if (run_diff_files(&rev, 0))
314-
die (_("Could not write patch"));
314+
die(_("Could not write patch"));
315315

316316
launch_editor(file, NULL, NULL);
317317

@@ -324,7 +324,7 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
324324
child.git_cmd = 1;
325325
child.argv = apply_argv;
326326
if (run_command(&child))
327-
die (_("Could not apply '%s'"), file);
327+
die(_("Could not apply '%s'"), file);
328328

329329
unlink(file);
330330
free(file);
@@ -582,7 +582,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
582582

583583
unplug_bulk_checkin();
584584

585-
finish:
585+
finish:
586586
if (active_cache_changed) {
587587
if (write_cache(newfd, active_cache, active_nr) ||
588588
commit_locked_index(&lock_file))

builtin/reset.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -330,11 +330,14 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
330330
die_if_unmerged_cache(reset_type);
331331

332332
if (reset_type != SOFT) {
333-
struct lock_file *lock = xcalloc(1, sizeof(struct lock_file));
333+
struct lock_file *lock = xcalloc(1, sizeof(*lock));
334334
int newfd = hold_locked_index(lock, 1);
335335
if (reset_type == MIXED) {
336+
int flags = quiet ? REFRESH_QUIET : REFRESH_IN_PORCELAIN;
336337
if (read_from_tree(&pathspec, sha1))
337338
return 1;
339+
refresh_index(&the_index, flags, NULL, NULL,
340+
_("Unstaged changes after reset:"));
338341
} else {
339342
int err = reset_index(sha1, reset_type, quiet);
340343
if (reset_type == KEEP && !err)
@@ -343,12 +346,6 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
343346
die(_("Could not reset index file to revision '%s'."), rev);
344347
}
345348

346-
if (reset_type == MIXED) { /* Report what has not been updated. */
347-
int flags = quiet ? REFRESH_QUIET : REFRESH_IN_PORCELAIN;
348-
refresh_index(&the_index, flags, NULL, NULL,
349-
_("Unstaged changes after reset:"));
350-
}
351-
352349
if (write_cache(newfd, active_cache, active_nr) ||
353350
commit_locked_index(lock))
354351
die(_("Could not write new index file."));

git-pull.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,8 @@ error_on_no_merge_candidates () {
187187
op_prep=with
188188
fi
189189

190-
curr_branch=${curr_branch#refs/heads/}
191-
upstream=$(git config "branch.$curr_branch.merge")
192-
remote=$(git config "branch.$curr_branch.remote")
190+
upstream=$(git config "branch.$curr_branch_short.merge")
191+
remote=$(git config "branch.$curr_branch_short.remote")
193192

194193
if [ $# -gt 1 ]; then
195194
if [ "$rebase" = true ]; then

0 commit comments

Comments
 (0)