summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/blob.c5
-rw-r--r--src/index.c2
2 files changed, 5 insertions, 2 deletions
diff --git a/src/blob.c b/src/blob.c
index b00fc25af..12f468ef7 100644
--- a/src/blob.c
+++ b/src/blob.c
@@ -78,7 +78,7 @@ int git_blob_create_frombuffer(git_oid *oid, git_repository *repo, const void *b
return GIT_SUCCESS;
}
-int git_blob_create_fromfile(git_oid *oid, git_repository *repo, const char *path, struct stat st)
+int git_blob_create_fromfile(git_oid *oid, git_repository *repo, const char *path)
{
int error, islnk;
int fd = 0;
@@ -86,6 +86,9 @@ int git_blob_create_fromfile(git_oid *oid, git_repository *repo, const char *pat
char buffer[2048];
git_off_t size;
git_odb_stream *stream;
+ struct stat st;
+
+ gitfo_lstat(path, &st);
islnk = S_ISLNK(st.st_mode);
diff --git a/src/index.c b/src/index.c
index afd9cfccd..3d2e72e56 100644
--- a/src/index.c
+++ b/src/index.c
@@ -434,7 +434,7 @@ static int index_init_entry(git_index_entry *entry, git_index *index, const char
entry->file_size = st.st_size;
/* write the blob to disk and get the oid */
- if ((error = git_blob_create_fromfile(&entry->oid, index->repository, rel_path, st)) < GIT_SUCCESS)
+ if ((error = git_blob_create_fromfile(&entry->oid, index->repository, rel_path)) < GIT_SUCCESS)
return git__rethrow(error, "Failed to initialize index entry");
entry->flags |= (stage << GIT_IDXENTRY_STAGESHIFT);