mirror of
https://github.com/git/git.git
synced 2024-11-14 13:13:01 +01:00
37d07f8f98
When recording a merge that conflicted and ends up in no changes after manual resolution, commit callchain looked like this: cmd_commit() -> prepare_log_message() -> run_status() -> wt_status_print() This invocation of run_status() is asked to find out if there is a committable change, but it unconditionally gave instructions such as "use git-add" at the same time. When in merge, we do allow an empty change to be recorded, so after showing this message the code still went ahead and made a commit. This introduces "nowarn" parameter to run_status() to avoid these useless messages. If we are not allowed to create an empty commit, we already call run_status() again in the original codepath, and the message will be shown from that call anyway. Signed-off-by: Junio C Hamano <gitster@pobox.com>
36 lines
711 B
C
36 lines
711 B
C
#ifndef STATUS_H
|
|
#define STATUS_H
|
|
|
|
#include <stdio.h>
|
|
|
|
enum color_wt_status {
|
|
WT_STATUS_HEADER,
|
|
WT_STATUS_UPDATED,
|
|
WT_STATUS_CHANGED,
|
|
WT_STATUS_UNTRACKED,
|
|
};
|
|
|
|
struct wt_status {
|
|
int is_initial;
|
|
char *branch;
|
|
const char *reference;
|
|
int verbose;
|
|
int amend;
|
|
int untracked;
|
|
int nowarn;
|
|
/* These are computed during processing of the individual sections */
|
|
int commitable;
|
|
int workdir_dirty;
|
|
int workdir_untracked;
|
|
const char *index_file;
|
|
FILE *fp;
|
|
const char *prefix;
|
|
};
|
|
|
|
int git_status_config(const char *var, const char *value);
|
|
int wt_status_use_color;
|
|
int wt_status_relative_paths;
|
|
void wt_status_prepare(struct wt_status *s);
|
|
void wt_status_print(struct wt_status *s);
|
|
|
|
#endif /* STATUS_H */
|