Skip to content

Commit

Permalink
Export rerere() and launch_editor().
Browse files Browse the repository at this point in the history
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Kristian Høgsberg authored and Junio C Hamano committed Sep 27, 2007
1 parent 5868016 commit d8b7db0
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
31 changes: 26 additions & 5 deletions builtin-rerere.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,18 +389,39 @@ static int is_rerere_enabled(void)
return 1;
}

int cmd_rerere(int argc, const char **argv, const char *prefix)
static int setup_rerere(struct path_list *merge_rr)
{
struct path_list merge_rr = { NULL, 0, 0, 1 };
int i, fd = -1;
int fd;

git_config(git_rerere_config);
if (!is_rerere_enabled())
return 0;
return -1;

merge_rr_path = xstrdup(git_path("rr-cache/MERGE_RR"));
fd = hold_lock_file_for_update(&write_lock, merge_rr_path, 1);
read_rr(&merge_rr);
read_rr(merge_rr);
return fd;
}

int rerere(void)
{
struct path_list merge_rr = { NULL, 0, 0, 1 };
int fd;

fd = setup_rerere(&merge_rr);
if (fd < 0)
return 0;
return do_plain_rerere(&merge_rr, fd);
}

int cmd_rerere(int argc, const char **argv, const char *prefix)
{
struct path_list merge_rr = { NULL, 0, 0, 1 };
int i, fd;

fd = setup_rerere(&merge_rr);
if (fd < 0)
return 0;

if (argc < 2)
return do_plain_rerere(&merge_rr, fd);
Expand Down
1 change: 1 addition & 0 deletions commit.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,6 @@ int in_merge_bases(struct commit *, struct commit **, int);

extern int interactive_add(void);
extern void add_files_to_cache(int verbose, const char *prefix, const char **files);
extern int rerere(void);

#endif /* COMMIT_H */

0 comments on commit d8b7db0

Please sign in to comment.