From fd84986f467b2556e0675d1df00f83b3a323cf2e Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Fri, 7 Oct 2016 18:08:38 +0200 Subject: wt-status: make the require_clean_work_tree() function reusable The function used by "git pull" to stop the user when the working tree has changes is useful in other places. Let's move it into a more prominent (and into an actually reusable) spot: wt-status.[ch]. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- wt-status.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'wt-status.h') diff --git a/wt-status.h b/wt-status.h index e401837707..68b4709835 100644 --- a/wt-status.h +++ b/wt-status.h @@ -128,4 +128,7 @@ void status_printf_ln(struct wt_status *s, const char *color, const char *fmt, . __attribute__((format (printf, 3, 4))) void status_printf(struct wt_status *s, const char *color, const char *fmt, ...); +/* The following function expects that the caller took care of reading the index. */ +int require_clean_work_tree(const char *action, const char *hint, int gently); + #endif /* STATUS_H */ -- cgit v1.2.3