summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 948dd34)
raw | patch | inline | side by side (parent: 948dd34)
author | Junio C Hamano <gitster@pobox.com> | |
Mon, 31 Mar 2008 00:30:08 +0000 (17:30 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 31 Mar 2008 05:22:09 +0000 (22:22 -0700) |
This fixes the same breakage in diff-files.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff-lib.c | patch | blob | history | |
t/t2201-add-update-typechange.sh | patch | blob | history |
diff --git a/diff-lib.c b/diff-lib.c
index ad9ed13fc990fa6084987b065531ef89d3e6b87c..069e4507ae7caa70f79d5369bc61dfefd0f174e2 100644 (file)
--- a/diff-lib.c
+++ b/diff-lib.c
int silent_on_removed = option & DIFF_SILENT_ON_REMOVED;
unsigned ce_option = ((option & DIFF_RACY_IS_MODIFIED)
? CE_MATCH_RACY_IS_DIRTY : 0);
+ char symcache[PATH_MAX];
if (diff_unmerged_stage < 0)
diff_unmerged_stage = 2;
entries = active_nr;
+ symcache[0] = '\0';
for (i = 0; i < entries; i++) {
struct stat st;
unsigned int oldmode, newmode;
memset(&(dpath->parent[0]), 0,
sizeof(struct combine_diff_parent)*5);
- if (lstat(ce->name, &st) < 0) {
- if (errno != ENOENT && errno != ENOTDIR) {
+ changed = check_work_tree_entity(ce, &st, symcache);
+ if (!changed)
+ dpath->mode = ce_mode_from_stat(ce, st.st_mode);
+ else {
+ if (changed < 0) {
perror(ce->name);
continue;
}
if (silent_on_removed)
continue;
}
- else
- dpath->mode = ce_mode_from_stat(ce, st.st_mode);
while (i < entries) {
struct cache_entry *nce = active_cache[i];
if (ce_uptodate(ce))
continue;
- if (lstat(ce->name, &st) < 0) {
- if (errno != ENOENT && errno != ENOTDIR) {
+
+ changed = check_work_tree_entity(ce, &st, symcache);
+ if (changed) {
+ if (changed < 0) {
perror(ce->name);
continue;
}
index 469a8e073992d1679e133265a93951a63132c0b4..e15e3eb81b11216f87a8010aa11edc0835e29b0f 100755 (executable)
} >expect-final
'
-test_expect_failure diff-files '
+test_expect_success diff-files '
git diff-files --raw >actual &&
diff -u expect-files actual
'
diff -u expect-index actual
'
-test_expect_failure 'add -u' '
+test_expect_success 'add -u' '
rm -f ".git/saved-index" &&
cp -p ".git/index" ".git/saved-index" &&
git add -u &&
diff -u expect-final actual
'
-test_expect_failure 'commit -a' '
+test_expect_success 'commit -a' '
if test -f ".git/saved-index"
then
rm -f ".git/index" &&