summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorLibravatar Phillip Wood <phillip.wood@dunelm.org.uk>2019-12-06 16:06:11 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-12-06 09:32:02 -0800
commit901ba7b1efe8ba9464aac528ecd46e8dd4f01003 (patch)
tree546da93b1d4d3f4360d84064836cb62396a690ce /builtin/commit.c
parentcommit: use enum value for multiple cherry-picks (diff)
downloadtgif-901ba7b1efe8ba9464aac528ecd46e8dd4f01003.tar.xz
commit: encapsulate determine_whence() for sequencer
Working out which command wants to create a commit requires detailed knowledge of the sequencer internals and that knowledge is going to increase in subsequent commits. With that in mind lets encapsulate that knowledge in sequencer.c rather than spreading it into builtin/commit.c. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
-rw-r--r--builtin/commit.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index f5e354c9f0..8a7c839d57 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -178,10 +178,7 @@ static void determine_whence(struct wt_status *s)
{
if (file_exists(git_path_merge_head(the_repository)))
whence = FROM_MERGE;
- else if (file_exists(git_path_cherry_pick_head(the_repository)))
- whence = file_exists(git_path_seq_dir()) ?
- FROM_CHERRY_PICK_MULTI : FROM_CHERRY_PICK_SINGLE;
- else
+ else if (!sequencer_determine_whence(the_repository, &whence))
whence = FROM_COMMIT;
if (s)
s->whence = whence;