summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6aff4d8)
raw | patch | inline | side by side (parent: 6aff4d8)
author | Jonas Fonseca <fonseca@diku.dk> | |
Mon, 6 Oct 2008 20:09:42 +0000 (22:09 +0200) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Mon, 6 Oct 2008 20:09:42 +0000 (22:09 +0200) |
tig.c | patch | blob | history |
index 3850387c4b10829a571ecb9c5ae27841aeca6c8d..2fff94e61b666bed37f66a989a386a5d4b0b629c 100644 (file)
--- a/tig.c
+++ b/tig.c
}
static bool
-status_checkout(struct status *status, enum line_type type, bool has_next)
+status_checkout(struct status *status, enum line_type type, bool has_none)
{
if (!status || type != LINE_STAT_UNSTAGED) {
- if (has_next) {
- report("Nothing to checkout");
+ if (type == LINE_STAT_STAGED) {
+ report("Cannot checkout staged files");
} else if (type == LINE_STAT_UNTRACKED) {
report("Cannot checkout untracked files");
- } else if (type == LINE_STAT_STAGED) {
- report("Cannot checkout staged files");
+ } else if (has_none) {
+ report("Nothing to checkout");
} else {
report("Cannot checkout multiple files");
}
break;
case REQ_STATUS_CHECKOUT:
- if (!status_checkout(&stage_status, stage_line_type, FALSE))
+ if (!status_checkout(stage_status.status ? &stage_status : NULL,
+ stage_line_type, FALSE))
return REQ_NONE;
break;