Code

Use "--" to separate file argument to git-checkout
authorJonas Fonseca <fonseca@diku.dk>
Tue, 14 Oct 2008 05:55:05 +0000 (07:55 +0200)
committerJonas Fonseca <fonseca@diku.dk>
Tue, 14 Oct 2008 05:55:05 +0000 (07:55 +0200)
tig.c

diff --git a/tig.c b/tig.c
index 507ecdbf5c6a3750e568a7505e1ef4614b3fb5d5..f436571c1f4dfb4e5b4294c3200aeb8d62b4896e 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -4394,7 +4394,7 @@ status_revert(struct status *status, enum line_type type, bool has_none)
                char file_sq[SIZEOF_STR];
 
                if (sq_quote(file_sq, 0, status->old.name) >= sizeof(file_sq) ||
-                   !string_format(cmd, "git checkout %s%s", opt_cdup, file_sq))
+                   !string_format(cmd, "git checkout -- %s%s", opt_cdup, file_sq))
                        return FALSE;
 
                return run_confirm(cmd, "Are you sure you want to overwrite any changes?");