summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/diff_tform.c8
-rw-r--r--src/indexer.c7
2 files changed, 8 insertions, 7 deletions
diff --git a/src/diff_tform.c b/src/diff_tform.c
index 7d8463573..03dd9c9f7 100644
--- a/src/diff_tform.c
+++ b/src/diff_tform.c
@@ -676,11 +676,13 @@ static bool is_rename_target(
return false;
/* only consider ADDED, RENAMED, COPIED, and split MODIFIED as
- * targets; maybe include UNTRACKED and IGNORED if requested.
+ * targets; maybe include UNTRACKED if requested.
*/
switch (delta->status) {
case GIT_DELTA_UNMODIFIED:
case GIT_DELTA_DELETED:
+ case GIT_DELTA_IGNORED:
+ case GIT_DELTA_CONFLICTED:
return false;
case GIT_DELTA_MODIFIED:
@@ -707,9 +709,6 @@ static bool is_rename_target(
return false;
break;
- case GIT_DELTA_IGNORED:
- return false;
-
default: /* all other status values should be checked */
break;
}
@@ -735,6 +734,7 @@ static bool is_rename_source(
case GIT_DELTA_UNTRACKED:
case GIT_DELTA_UNREADABLE:
case GIT_DELTA_IGNORED:
+ case GIT_DELTA_CONFLICTED:
return false;
case GIT_DELTA_DELETED:
diff --git a/src/indexer.c b/src/indexer.c
index ef2ac3cba..512addf48 100644
--- a/src/indexer.c
+++ b/src/indexer.c
@@ -478,13 +478,14 @@ static int write_at(git_indexer *idx, const void *data, git_off_t offset, size_t
static int append_to_pack(git_indexer *idx, const void *data, size_t size)
{
git_off_t current_size = idx->pack->mwf.size;
+ int fd = idx->pack->mwf.fd;
if (!size)
return 0;
- /* add the extra space we need at the end */
- if (p_ftruncate(idx->pack->mwf.fd, current_size + size) < 0) {
- giterr_set(GITERR_OS, "Failed to increase size of pack file '%s'", idx->pack->pack_name);
+ if (p_lseek(fd, current_size + size - 1, SEEK_SET) < 0 ||
+ p_write(idx->pack->mwf.fd, data, 1) < 0) {
+ giterr_set(GITERR_OS, "cannot extend packfile '%s'", idx->pack->pack_name);
return -1;
}