summaryrefslogtreecommitdiff
path: root/sequencer.h
diff options
context:
space:
mode:
authorDenton Liu <liu.denton@gmail.com>2020-04-07 14:28:05 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-04-10 16:28:02 (GMT)
commit12b6e1367af429628dbaeaa0c7518cacc620d786 (patch)
treef0c184f39767fe56b556e8269c1736c57c67042d /sequencer.h
parent0dd562e0f7c0bb9ca64f1a02265ff5d1be86df34 (diff)
downloadgit-12b6e1367af429628dbaeaa0c7518cacc620d786.zip
git-12b6e1367af429628dbaeaa0c7518cacc620d786.tar.gz
git-12b6e1367af429628dbaeaa0c7518cacc620d786.tar.bz2
sequencer: implement save_autostash()
Extract common functionality of apply_autostash() into apply_save_autostash() and use it to implement save_autostash(). This function will be used in a future commit. The difference between save_autostash() and apply_autostash() is that the former does not try to apply the stash. It skips that step and just stores the created entry in the stash reflog. This is useful in the case where we abort an operation when an autostash is present but we don't want to dirty the worktree with the application of the stash. For example, in a future commit, we will implement `git merge --autostash`. Since merges can be aborted using `git reset --hard`, we'd make use of save_autostash() to save the autostash entry instead of applying it to the worktree thus keeping the worktree undirtied. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sequencer.h')
-rw-r--r--sequencer.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sequencer.h b/sequencer.h
index 9d1fe0c..306d4ce 100644
--- a/sequencer.h
+++ b/sequencer.h
@@ -193,6 +193,7 @@ void commit_post_rewrite(struct repository *r,
void create_autostash(struct repository *r, const char *path,
const char *default_reflog_action);
+int save_autostash(const char *path);
int apply_autostash(const char *path);
#define SUMMARY_INITIAL_COMMIT (1 << 0)