diff options
author | Junio C Hamano <junkio@cox.net> | 2007-02-26 00:32:19 -0800 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-02-26 00:32:19 -0800 |
commit | 8807d321af394ffb2180d085669337bcd5018c50 (patch) | |
tree | 2956464a49a82a210612a2ea030a6affc12a67aa /diff-lib.c | |
parent | Merge branch 'maint' (diff) | |
parent | GIT 1.5.0.2 (diff) | |
download | tgif-8807d321af394ffb2180d085669337bcd5018c50.tar.xz |
Merge branch 'maint'
* maint:
GIT 1.5.0.2
git-remote: support remotes with a dot in the name
Documentation: describe "-f/-t/-m" options to "git-remote add"
diff --cc: fix display of symlink conflicts during a merge.
Diffstat (limited to 'diff-lib.c')
-rw-r--r-- | diff-lib.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/diff-lib.c b/diff-lib.c index 556d5345bf..60c0fa6488 100644 --- a/diff-lib.c +++ b/diff-lib.c @@ -41,17 +41,27 @@ int run_diff_files(struct rev_info *revs, int silent_on_removed) path_len = ce_namelen(ce); - dpath = xmalloc (combine_diff_path_size (5, path_len)); + dpath = xmalloc(combine_diff_path_size(5, path_len)); dpath->path = (char *) &(dpath->parent[5]); dpath->next = NULL; dpath->len = path_len; memcpy(dpath->path, ce->name, path_len); dpath->path[path_len] = '\0'; - dpath->mode = 0; hashclr(dpath->sha1); memset(&(dpath->parent[0]), 0, - sizeof(struct combine_diff_parent)*5); + sizeof(struct combine_diff_parent)*5); + + if (lstat(ce->name, &st) < 0) { + if (errno != ENOENT && errno != ENOTDIR) { + perror(ce->name); + continue; + } + if (silent_on_removed) + continue; + } + else + dpath->mode = canon_mode(st.st_mode); while (i < entries) { struct cache_entry *nce = active_cache[i]; |