Skip to content

Commit

Permalink
Merge branch 'jn/merge-no-edit-fix'
Browse files Browse the repository at this point in the history
* jn/merge-no-edit-fix:
  merge: do not launch an editor on "--no-edit $tag"

Conflicts:
	builtin/merge.c
  • Loading branch information
Junio C Hamano committed Feb 13, 2012
2 parents b6b3b6a + 3adab6f commit 5cdc9fb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion builtin/merge.c
Original file line number Diff line number Diff line change
Expand Up @@ -1324,7 +1324,8 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
merge_remote_util(commit) &&
merge_remote_util(commit)->obj &&
merge_remote_util(commit)->obj->type == OBJ_TAG) {
option_edit = 1;
if (option_edit < 0)
option_edit = 1;
allow_fast_forward = 0;
}
}
Expand Down
12 changes: 12 additions & 0 deletions t/t7600-merge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -683,4 +683,16 @@ test_expect_success GPG 'merge --ff-only tag' '
test_cmp actual expect
'

test_expect_success GPG 'merge --no-edit tag should skip editor' '
git reset --hard c0 &&
git commit --allow-empty -m "A newer commit" &&
git tag -f -s -m "A newer commit" signed &&
git reset --hard c0 &&
EDITOR=false git merge --no-edit signed &&
git rev-parse signed^0 >expect &&
git rev-parse HEAD^2 >actual &&
test_cmp actual expect
'

test_done

0 comments on commit 5cdc9fb

Please sign in to comment.