diff options
author | Junio C Hamano <junkio@cox.net> | 2007-04-21 17:21:10 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-04-21 17:21:10 -0700 |
commit | afb5b6a24bd333d298d10acac731f1c127bbb82d (patch) | |
tree | 9c403d4fa96f00d172e5b0a95602b68be839086f /diff-lib.c | |
parent | 99ebd06c18fdb7f8274db6cca456a95942916bb6 (diff) | |
parent | 1c3e5c4ebc326c5c70350d3f4dc7f2b29e813480 (diff) | |
download | git-afb5b6a24bd333d298d10acac731f1c127bbb82d.tar.gz |
Merge branch 'lt/gitlink'
* lt/gitlink:
Tests for core subproject support
Expose subprojects as special files to "git diff" machinery
Fix some "git ls-files -o" fallout from gitlinks
Teach "git-read-tree -u" to check out submodules as a directory
Teach git list-objects logic to not follow gitlinks
Fix gitlink index entry filesystem matching
Teach "git-read-tree -u" to check out submodules as a directory
Teach git list-objects logic not to follow gitlinks
Don't show gitlink directories when we want "other" files
Teach git-update-index about gitlinks
Teach directory traversal about subprojects
Fix thinko in subproject entry sorting
Teach core object handling functions about gitlinks
Teach "fsck" not to follow subproject links
Add "S_IFDIRLNK" file mode infrastructure for git links
Add 'resolve_gitlink_ref()' helper function
Avoid overflowing name buffer in deep directory structures
diff-lib: use ce_mode_from_stat() rather than messing with modes manually
Diffstat (limited to 'diff-lib.c')
-rw-r--r-- | diff-lib.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/diff-lib.c b/diff-lib.c index 7531e20c78..07f4e8106a 100644 --- a/diff-lib.c +++ b/diff-lib.c @@ -373,7 +373,7 @@ int run_diff_files(struct rev_info *revs, int silent_on_removed) continue; } else - dpath->mode = canon_mode(st.st_mode); + dpath->mode = ntohl(ce_mode_from_stat(ce, st.st_mode)); while (i < entries) { struct cache_entry *nce = active_cache[i]; @@ -390,8 +390,7 @@ int run_diff_files(struct rev_info *revs, int silent_on_removed) int mode = ntohl(nce->ce_mode); num_compare_stages++; hashcpy(dpath->parent[stage-2].sha1, nce->sha1); - dpath->parent[stage-2].mode = - canon_mode(mode); + dpath->parent[stage-2].mode = ntohl(ce_mode_from_stat(nce, mode)); dpath->parent[stage-2].status = DIFF_STATUS_MODIFIED; } @@ -440,15 +439,7 @@ int run_diff_files(struct rev_info *revs, int silent_on_removed) if (!changed && !revs->diffopt.find_copies_harder) continue; oldmode = ntohl(ce->ce_mode); - - newmode = canon_mode(st.st_mode); - if (!trust_executable_bit && - S_ISREG(newmode) && S_ISREG(oldmode) && - ((newmode ^ oldmode) == 0111)) - newmode = oldmode; - else if (!has_symlinks && - S_ISREG(newmode) && S_ISLNK(oldmode)) - newmode = oldmode; + newmode = ntohl(ce_mode_from_stat(ce, st.st_mode)); diff_change(&revs->diffopt, oldmode, newmode, ce->sha1, (changed ? null_sha1 : ce->sha1), ce->name, NULL); |