summaryrefslogtreecommitdiff
path: root/src/index.c
diff options
context:
space:
mode:
authorAlex Budovski <abudovski@gmail.com>2011-01-11 16:07:45 +1100
committerAlex Budovski <abudovski@gmail.com>2011-01-11 18:31:55 +1100
commitf0bde7fac0796bb6d7bfe794bd049041f2133905 (patch)
tree8d0b13c20236ca2faa2017fe9ca4fa69b9efb0a5 /src/index.c
parente0c23b88c57a5d765e5572d8ed317a4ba4da102a (diff)
downloadlibgit2-f0bde7fac0796bb6d7bfe794bd049041f2133905.tar.gz
Revised platform types to use 'best supported' size.
This will allow graceful migration to 64 bit file sizes and timestamps should git's binary interface be extended to allow this.
Diffstat (limited to 'src/index.c')
-rw-r--r--src/index.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/index.c b/src/index.c
index e861d7982..6fdb46e18 100644
--- a/src/index.c
+++ b/src/index.c
@@ -303,12 +303,8 @@ int git_index_add(git_index *index, const char *rel_path, int stage)
memset(&entry, 0x0, sizeof(git_index_entry));
- /* Note: this won't wrap around at 2038 because we're not storing signed
- * 32-bit integers, but unsigned ones. We're converting from signed 64-bit
- * integers (on platforms that use 64bit time_t) to unsigned 32-bit integers,
- * which will represent up to 2^32 - 1 seconds after the epoch */
- entry.ctime.seconds = (unsigned int)st.st_ctime;
- entry.mtime.seconds = (unsigned int)st.st_mtime;
+ entry.ctime.seconds = st.st_ctime;
+ entry.mtime.seconds = st.st_mtime;
/* entry.mtime.nanoseconds = st.st_mtimensec; */
/* entry.ctime.nanoseconds = st.st_ctimensec; */
entry.dev= st.st_rdev;
@@ -316,8 +312,7 @@ int git_index_add(git_index *index, const char *rel_path, int stage)
entry.mode = st.st_mode;
entry.uid = st.st_uid;
entry.gid = st.st_gid;
- /* Note: the following restricts blobs to 4GB in size */
- entry.file_size = (unsigned int)st.st_size;
+ entry.file_size = st.st_size;
/* write the blob to disk and get the oid */
if ((error = git_blob_writefile(&entry.oid, index->repository, full_path)) < GIT_SUCCESS)