show commit progress output when 'got merge -c' is used Otherwise no progress output is shown at all with this command. Commit progress output will also display any additional changes which resulted from conflict resolution. ok millert@
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
diff --git a/got/got.c b/got/got.c
index 2ffb450..f7b2014 100644
--- a/got/got.c
+++ b/got/got.c
@@ -10814,7 +10814,8 @@ cmd_merge(int argc, char *argv[])
goto done;
} else {
error = got_worktree_merge_commit(&merge_commit_id, worktree,
- fileindex, author, NULL, 1, branch_tip, branch_name, repo);
+ fileindex, author, NULL, 1, branch_tip, branch_name,
+ repo, continue_merge ? print_status : NULL, NULL);
if (error)
goto done;
error = got_worktree_merge_complete(worktree, fileindex, repo);
diff --git a/include/got_worktree.h b/include/got_worktree.h
index 0dcba98..2402196 100644
--- a/include/got_worktree.h
+++ b/include/got_worktree.h
@@ -456,7 +456,8 @@ got_worktree_merge_commit(struct got_object_id **new_commit_id,
struct got_worktree *worktree, struct got_fileindex *fileindex,
const char *author, const char *committer, int allow_bad_symlinks,
struct got_object_id *branch_tip, const char *branch_name,
- struct got_repository *repo);
+ struct got_repository *repo,
+ got_worktree_status_cb status_cb, void *status_arg);
/*
* Complete the merge operation.
diff --git a/lib/worktree.c b/lib/worktree.c
index 0c6b89c..2fab187 100644
--- a/lib/worktree.c
+++ b/lib/worktree.c
@@ -5221,6 +5221,9 @@ report_ct_status(struct got_commitable *ct,
const char *ct_path = ct->path;
unsigned char status;
+ if (status_cb == NULL) /* no commit progress output desired */
+ return NULL;
+
while (ct_path[0] == '/')
ct_path++;
@@ -7500,14 +7503,6 @@ merge_commit_msg_cb(struct got_pathlist_head *commitable_paths, char **logmsg,
return NULL;
}
-static const struct got_error *
-merge_status_cb(void *arg, unsigned char status, unsigned char staged_status,
- const char *path, struct got_object_id *blob_id,
- struct got_object_id *staged_blob_id, struct got_object_id *commit_id,
- int dirfd, const char *de_name)
-{
- return NULL;
-}
const struct got_error *
got_worktree_merge_branch(struct got_worktree *worktree,
@@ -7542,7 +7537,9 @@ got_worktree_merge_commit(struct got_object_id **new_commit_id,
struct got_worktree *worktree, struct got_fileindex *fileindex,
const char *author, const char *committer, int allow_bad_symlinks,
struct got_object_id *branch_tip, const char *branch_name,
- struct got_repository *repo)
+ struct got_repository *repo,
+ got_worktree_status_cb status_cb, void *status_arg)
+
{
const struct got_error *err = NULL, *sync_err;
struct got_pathlist_head commitable_paths;
@@ -7614,7 +7611,7 @@ got_worktree_merge_commit(struct got_object_id **new_commit_id,
mcm_arg.branch_name = branch_name;
err = commit_worktree(new_commit_id, &commitable_paths,
head_commit_id, branch_tip, worktree, author, committer,
- merge_commit_msg_cb, &mcm_arg, merge_status_cb, NULL, repo);
+ merge_commit_msg_cb, &mcm_arg, status_cb, status_arg, repo);
if (err)
goto done;
diff --git a/regress/cmdline/merge.sh b/regress/cmdline/merge.sh
index 38220a8..d4e0cb2 100755
--- a/regress/cmdline/merge.sh
+++ b/regress/cmdline/merge.sh
@@ -492,8 +492,12 @@ test_merge_continue() {
local merge_commit=`git_show_head $testroot/repo`
+ echo "M alpha" > $testroot/stdout.expected
+ echo "D beta" >> $testroot/stdout.expected
+ echo "A epsilon/new" >> $testroot/stdout.expected
+ echo "M gamma/delta" >> $testroot/stdout.expected
echo -n "Merged refs/heads/newbranch into refs/heads/master: " \
- > $testroot/stdout.expected
+ >> $testroot/stdout.expected
echo $merge_commit >> $testroot/stdout.expected
cmp -s $testroot/stdout.expected $testroot/stdout
@@ -1324,8 +1328,9 @@ test_merge_interrupt() {
local merge_commit=`git_show_head $testroot/repo`
+ echo "M alpha" > $testroot/stdout.expected
echo -n "Merged refs/heads/newbranch into refs/heads/master: " \
- > $testroot/stdout.expected
+ >> $testroot/stdout.expected
echo $merge_commit >> $testroot/stdout.expected
cmp -s $testroot/stdout.expected $testroot/stdout