summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 10b1023)
raw | patch | inline | side by side (parent: 10b1023)
author | Jonas Fonseca <fonseca@diku.dk> | |
Mon, 5 Jan 2009 01:26:24 +0000 (20:26 -0500) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Tue, 13 Jan 2009 21:55:18 +0000 (22:55 +0100) |
tig.c | patch | blob | history |
index 9a7a3a732f013bd56117ae07dd3b5106195f60a5..d77180928d42e710323f6266ac024bdaf4bb8867 100644 (file)
--- a/tig.c
+++ b/tig.c
update_view_title(view);
}
-static bool
-run_confirm(const char *cmd, const char *prompt)
-{
- bool confirmation = prompt_yesno(prompt);
-
- if (confirmation)
- system(cmd);
-
- return confirmation;
-}
-
static void
open_external_viewer(const char *argv[], const char *dir)
{
return FALSE;
} else {
- char cmd[SIZEOF_STR];
- char file_sq[SIZEOF_STR];
+ const char *checkout_argv[] = {
+ "git", "checkout", "--", status->old.name, NULL
+ };
- if (sq_quote(file_sq, 0, status->old.name) >= sizeof(file_sq) ||
- !string_format(cmd, "git checkout -- %s%s", opt_cdup, file_sq))
+ if (!prompt_yesno("Are you sure you want to overwrite any changes?"))
return FALSE;
-
- return run_confirm(cmd, "Are you sure you want to overwrite any changes?");
+ return run_io_fg(checkout_argv, opt_cdup);
}
}