diff options
| author | Russell Belfer <rb@github.com> | 2013-06-27 11:11:12 -0700 |
|---|---|---|
| committer | Russell Belfer <rb@github.com> | 2013-06-27 11:11:12 -0700 |
| commit | c8a39f9ee3ce8aa73a489b72006f0e3c27cc5911 (patch) | |
| tree | 23bb5db9b21586bf91197a31d82a9fb47731de84 /src | |
| parent | b0401c686788300bd4fb16cf395533458611eda1 (diff) | |
| parent | c67ff958c4d8e37a717c77dd9cdb4bdfc88a6fd8 (diff) | |
| download | libgit2-c8a39f9ee3ce8aa73a489b72006f0e3c27cc5911.tar.gz | |
Merge pull request #1684 from libgit2/fix-dirty-submodule-diff
Dirty submodules do not correctly appear in diffs
Diffstat (limited to 'src')
| -rw-r--r-- | src/diff_patch.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/diff_patch.c b/src/diff_patch.c index 9060d0a24..1b4adac03 100644 --- a/src/diff_patch.c +++ b/src/diff_patch.c @@ -10,6 +10,7 @@ #include "diff_driver.h" #include "diff_patch.h" #include "diff_xdiff.h" +#include "fileops.h" /* cached information about a single span in a diff */ typedef struct diff_patch_line diff_patch_line; @@ -175,9 +176,12 @@ static int diff_patch_load(git_diff_patch *patch, git_diff_output *output) goto cleanup; } - /* if we were previously missing an oid, update MODIFIED->UNMODIFIED */ + /* if previously missing an oid, and now that we have it the two sides + * are the same (and not submodules), update MODIFIED -> UNMODIFIED + */ if (incomplete_data && patch->ofile.file->mode == patch->nfile.file->mode && + patch->ofile.file->mode != GIT_FILEMODE_COMMIT && git_oid_equal(&patch->ofile.file->oid, &patch->nfile.file->oid) && patch->delta->status == GIT_DELTA_MODIFIED) /* not RENAMED/COPIED! */ patch->delta->status = GIT_DELTA_UNMODIFIED; |
