summaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2011-11-18 11:11:28 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-11-18 19:55:05 (GMT)
commit4bd4e73093eb741a87b7d80bc84469d880f4e2f3 (patch)
treed21114b70ddd0407dd2ee6a6556aa798f19738e4 /read-cache.c
parentd05e69701053c0cf786e99251879f860702374b7 (diff)
downloadgit-4bd4e73093eb741a87b7d80bc84469d880f4e2f3.zip
git-4bd4e73093eb741a87b7d80bc84469d880f4e2f3.tar.gz
git-4bd4e73093eb741a87b7d80bc84469d880f4e2f3.tar.bz2
refresh_index: rename format variables
When refreshing the index, for modified (or unmerged) files we will print "needs update" (or "needs merge") for plumbing, or line similar to the output from "diff --name-status" for porcelain. The variables holding which type of message to show are named after the plumbing messages. However, as we begin to differentiate more cases at the porcelain level (with the plumbing message staying the same), that naming scheme will become awkward. Instead, name the variables after which case we found (modified or unmerged), not what we will output. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/read-cache.c b/read-cache.c
index 8e69ea3..f19b2f1 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -1105,11 +1105,11 @@ int refresh_index(struct index_state *istate, unsigned int flags, const char **p
int first = 1;
int in_porcelain = (flags & REFRESH_IN_PORCELAIN);
unsigned int options = really ? CE_MATCH_IGNORE_VALID : 0;
- const char *needs_update_fmt;
- const char *needs_merge_fmt;
+ const char *modified_fmt;
+ const char *unmerged_fmt;
- needs_update_fmt = (in_porcelain ? "M\t%s\n" : "%s: needs update\n");
- needs_merge_fmt = (in_porcelain ? "U\t%s\n" : "%s: needs merge\n");
+ modified_fmt = (in_porcelain ? "M\t%s\n" : "%s: needs update\n");
+ unmerged_fmt = (in_porcelain ? "U\t%s\n" : "%s: needs merge\n");
for (i = 0; i < istate->cache_nr; i++) {
struct cache_entry *ce, *new;
int cache_errno = 0;
@@ -1125,7 +1125,7 @@ int refresh_index(struct index_state *istate, unsigned int flags, const char **p
i--;
if (allow_unmerged)
continue;
- show_file(needs_merge_fmt, ce->name, in_porcelain, &first, header_msg);
+ show_file(unmerged_fmt, ce->name, in_porcelain, &first, header_msg);
has_errors = 1;
continue;
}
@@ -1148,7 +1148,7 @@ int refresh_index(struct index_state *istate, unsigned int flags, const char **p
}
if (quiet)
continue;
- show_file(needs_update_fmt, ce->name, in_porcelain, &first, header_msg);
+ show_file(modified_fmt, ce->name, in_porcelain, &first, header_msg);
has_errors = 1;
continue;
}