diff options
author | Russell Belfer <rb@github.com> | 2012-06-19 14:27:02 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2012-06-19 14:27:02 -0700 |
commit | da825c92d92433240ceeaea70d7618395bcfb83d (patch) | |
tree | 1cdf8d9c08d101d0ebc40b7e07eb4ba1c41611b2 /src/diff.c | |
parent | 1b0ef5aa03fad68105784d5d4d87592ce005e03a (diff) | |
download | libgit2-da825c92d92433240ceeaea70d7618395bcfb83d.tar.gz |
Make index add/append support core.filemode flag
This fixes git_index_add and git_index_append to behave more like
core git, preserving old filemode data in the index when adding
and/or appending with core.filemode = false.
This also has placeholder support for core.symlinks and
core.ignorecase, but those flags are not implemented (well,
symlinks has partial support for preserving mode information in
the same way that git does, but it isn't tested).
Diffstat (limited to 'src/diff.c')
-rw-r--r-- | src/diff.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/diff.c b/src/diff.c index 02b89b46e..bc8708e33 100644 --- a/src/diff.c +++ b/src/diff.c @@ -456,10 +456,10 @@ static int maybe_modified( if (!diff_path_matches_pathspec(diff, oitem->path)) return 0; - /* on platforms with no symlinks, promote plain files to symlinks */ + /* on platforms with no symlinks, preserve mode of existing symlinks */ if (S_ISLNK(omode) && S_ISREG(nmode) && !(diff->diffcaps & GIT_DIFFCAPS_HAS_SYMLINKS)) - nmode = GIT_MODE_TYPE(omode) | (nmode & GIT_MODE_PERMS_MASK); + nmode = omode; /* on platforms with no execmode, just preserve old mode */ if (!(diff->diffcaps & GIT_DIFFCAPS_TRUST_MODE_BITS) && |