diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-05-25 16:23:26 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-05-25 16:23:26 -0700 |
commit | 5cfe4256d98af22a570c78c5e3048391a90f5f98 (patch) | |
tree | 2a168e5e4c4f52e0c58c6078304c9757f728c4e6 /builtin/hash-object.c | |
parent | 84da3e21dc008fe7ba18811e8b7f7614ede33079 (diff) | |
parent | 4dd1fbc7b1df0030f813a05cee19cad2c7a9cbf9 (diff) | |
download | git-5cfe4256d98af22a570c78c5e3048391a90f5f98.tar.gz |
Merge branch 'jc/bigfile'
* jc/bigfile:
Bigfile: teach "git add" to send a large file straight to a pack
index_fd(): split into two helper functions
index_fd(): turn write_object and format_check arguments into one flag
Diffstat (limited to 'builtin/hash-object.c')
-rw-r--r-- | builtin/hash-object.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin/hash-object.c b/builtin/hash-object.c index b96f46acf5..33911fd5e9 100644 --- a/builtin/hash-object.c +++ b/builtin/hash-object.c @@ -14,8 +14,11 @@ static void hash_fd(int fd, const char *type, int write_object, const char *path { struct stat st; unsigned char sha1[20]; + unsigned flags = (HASH_FORMAT_CHECK | + (write_object ? HASH_WRITE_OBJECT : 0)); + if (fstat(fd, &st) < 0 || - index_fd(sha1, fd, &st, write_object, type_from_string(type), path, 1)) + index_fd(sha1, fd, &st, type_from_string(type), path, flags)) die(write_object ? "Unable to add %s to database" : "Unable to hash %s", path); |