diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-10-26 02:06:57 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-10-26 02:06:57 +0300 |
commit | 6ffb5fc06940ebb312b5cb010246e27c1b6aead0 (patch) | |
tree | 92e7686a64e75480b282d715971594674f25554f /read-cache.c | |
parent | 525705a0a24ec13aedda8acc5f826295f7888c0e (diff) | |
parent | e578d0311d7b19ebd8cdadc6941f2aa060b7a850 (diff) |
Merge branch 'rs/add-dry-run-without-objects'
Stop "git add --dry-run" from creating new blob and tree objects.
* rs/add-dry-run-without-objects:
add: don't write objects with --dry-run
Diffstat (limited to 'read-cache.c')
-rw-r--r-- | read-cache.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/read-cache.c b/read-cache.c index 8a50ff66b3..f398659662 100644 --- a/read-cache.c +++ b/read-cache.c @@ -738,7 +738,7 @@ int add_to_index(struct index_state *istate, const char *path, struct stat *st, int intent_only = flags & ADD_CACHE_INTENT; int add_option = (ADD_CACHE_OK_TO_ADD|ADD_CACHE_OK_TO_REPLACE| (intent_only ? ADD_CACHE_NEW_ONLY : 0)); - int hash_flags = HASH_WRITE_OBJECT; + unsigned hash_flags = pretend ? 0 : HASH_WRITE_OBJECT; struct object_id oid; if (flags & ADD_CACHE_RENORMALIZE) |