summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/git2/checkout.h24
-rw-r--r--src/merge.c7
2 files changed, 16 insertions, 15 deletions
diff --git a/include/git2/checkout.h b/include/git2/checkout.h
index ad44173e6..fe4966aa2 100644
--- a/include/git2/checkout.h
+++ b/include/git2/checkout.h
@@ -233,18 +233,18 @@ typedef void (*git_checkout_progress_cb)(
typedef struct git_checkout_options {
unsigned int version;
- unsigned int checkout_strategy; /** default will be a dry run */
+ unsigned int checkout_strategy; /**< default will be a dry run */
- int disable_filters; /** don't apply filters like CRLF conversion */
- unsigned int dir_mode; /** default is 0755 */
- unsigned int file_mode; /** default is 0644 or 0755 as dictated by blob */
- int file_open_flags; /** default is O_CREAT | O_TRUNC | O_WRONLY */
+ int disable_filters; /**< don't apply filters like CRLF conversion */
+ unsigned int dir_mode; /**< default is 0755 */
+ unsigned int file_mode; /**< default is 0644 or 0755 as dictated by blob */
+ int file_open_flags; /**< default is O_CREAT | O_TRUNC | O_WRONLY */
- unsigned int notify_flags; /** see `git_checkout_notify_t` above */
+ unsigned int notify_flags; /**< see `git_checkout_notify_t` above */
git_checkout_notify_cb notify_cb;
void *notify_payload;
- /* Optional callback to notify the consumer of checkout progress. */
+ /** Optional callback to notify the consumer of checkout progress. */
git_checkout_progress_cb progress_cb;
void *progress_payload;
@@ -254,13 +254,13 @@ typedef struct git_checkout_options {
*/
git_strarray paths;
- git_tree *baseline; /** expected content of workdir, defaults to HEAD */
+ git_tree *baseline; /**< expected content of workdir, defaults to HEAD */
- const char *target_directory; /** alternative checkout path to workdir */
+ const char *target_directory; /**< alternative checkout path to workdir */
- const char *ancestor_label; /** the name of the common ancestor side of conflicts */
- const char *our_label; /** the name of the "our" side of conflicts */
- const char *their_label; /** the name of the "their" side of conflicts */
+ const char *ancestor_label; /**< the name of the common ancestor side of conflicts */
+ const char *our_label; /**< the name of the "our" side of conflicts */
+ const char *their_label; /**< the name of the "their" side of conflicts */
} git_checkout_options;
#define GIT_CHECKOUT_OPTIONS_VERSION 1
diff --git a/src/merge.c b/src/merge.c
index 68c9f66e2..f8d008a6d 100644
--- a/src/merge.c
+++ b/src/merge.c
@@ -2380,12 +2380,14 @@ int git_merge__append_conflicts_to_merge_msg(
size_t i;
int error;
+ if (!git_index_has_conflicts(index))
+ return 0;
+
if ((error = git_buf_joinpath(&file_path, repo->path_repository, GIT_MERGE_MSG_FILE)) < 0 ||
(error = git_filebuf_open(&file, file_path.ptr, GIT_FILEBUF_APPEND, GIT_MERGE_FILE_MODE)) < 0)
goto cleanup;
- if (git_index_has_conflicts(index))
- git_filebuf_printf(&file, "\nConflicts:\n");
+ git_filebuf_printf(&file, "\nConflicts:\n");
for (i = 0; i < git_index_entrycount(index); i++) {
const git_index_entry *e = git_index_get_byindex(index, i);
@@ -2410,7 +2412,6 @@ cleanup:
return error;
}
-
static int merge_state_cleanup(git_repository *repo)
{
const char *state_files[] = {