From: Ramkumar Ramachandra Date: Wed, 25 May 2011 14:16:56 GMT Subject: [PATCH 01/10] advice: Introduce error_resolve_conflict Message-ID: <1306333025-29893-2-git-send-email-artagnon@gmail.com> In-Reply-To: <1306333025-29893-1-git-send-email-artagnon@gmail.com> Introduce error_resolve_conflict corresponding to die_resolve_conflict, and implement the latter function in terms of the former. Based-on-patch-by: Christian Couder Helped-by: Jonathan Nieder Signed-off-by: Ramkumar Ramachandra --- advice.c | 17 +++++++++++------ advice.h | 1 + 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/advice.c b/advice.c index 0be4b5f..80aaa14 100644 --- a/advice.c +++ b/advice.c @@ -34,16 +34,21 @@ int git_default_advice_config(const char *var, const char *value) return 0; } -void NORETURN die_resolve_conflict(const char *me) +int error_resolve_conflict(const char *me) { if (advice_resolve_conflict) /* * Message used both when 'git commit' fails and when * other commands doing a merge do. */ - die("'%s' is not possible because you have unmerged files.\n" - "Please, fix them up in the work tree, and then use 'git add/rm ' as\n" - "appropriate to mark resolution and make a commit, or use 'git commit -a'.", me); - else - die("'%s' is not possible because you have unmerged files.", me); + return error("'%s' is not possible because you have unmerged files.\n" + "Please, fix them up in the work tree, and then use 'git add/rm ' as\n" + "appropriate to mark resolution and make a commit, or use 'git commit -a'.", me); + return error("'%s' is not possible because you have unmerged files.", me); +} + +void NORETURN die_resolve_conflict(const char *me) +{ + error_resolve_conflict(me); + exit(128); } diff --git a/advice.h b/advice.h index 3244ebb..f537366 100644 --- a/advice.h +++ b/advice.h @@ -12,6 +12,7 @@ extern int advice_detached_head; int git_default_advice_config(const char *var, const char *value); +int error_resolve_conflict(const char *me); extern void NORETURN die_resolve_conflict(const char *me); #endif /* ADVICE_H */ -- 1.7.5.GIT