summaryrefslogtreecommitdiff
path: root/builtin-reset.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2008-07-20 00:21:38 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2008-07-20 17:21:32 -0700
commitd14e7407b34b8c11b407358b9677c283c381a71c (patch)
tree2ea98209de908a49d8841a7fc6ccb1e5b186795e /builtin-reset.c
parentMove read_in_full() and write_in_full() to wrapper.c (diff)
downloadtgif-d14e7407b34b8c11b407358b9677c283c381a71c.tar.xz
"needs update" considered harmful
"git update-index --refresh", "git reset" and "git add --refresh" have reported paths that have local modifications as "needs update" since the beginning of git. Although this is logically correct in that you need to update the index at that path before you can commit that change, it is now becoming more and more clear, especially with the continuous push for user friendliness since 1.5.0 series, that the message is suboptimal. After all, the change may be something the user might want to get rid of, and "updating" would be absolutely a wrong thing to do if that is the case. I prepared two alternatives to solve this. Both aim to reword the message to more neutral "locally modified". This patch is a more intrusive variant that changes the message for only Porcelain commands ("add" and "reset") while keeping the plumbing "update-index" intact. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-reset.c')
-rw-r--r--builtin-reset.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin-reset.c b/builtin-reset.c
index 2e5a8867ac..4d246c31b1 100644
--- a/builtin-reset.c
+++ b/builtin-reset.c
@@ -96,7 +96,7 @@ static int update_index_refresh(int fd, struct lock_file *index_lock)
if (read_cache() < 0)
return error("Could not read index");
- result = refresh_cache(0) ? 1 : 0;
+ result = refresh_cache(REFRESH_SAY_CHANGED) ? 1 : 0;
if (write_cache(fd, active_cache, active_nr) ||
commit_locked_index(index_lock))
return error ("Could not refresh index");