]> git.ipfire.org Git - thirdparty/git.git/commit
add: don't write objects with --dry-run
authorRené Scharfe <l.s.r@web.de>
Tue, 12 Oct 2021 19:15:50 +0000 (21:15 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 12 Oct 2021 20:15:49 +0000 (13:15 -0700)
commite578d0311d7b19ebd8cdadc6941f2aa060b7a850
treef7f26ad95ecc649be1975037aaab1b09af7bcd34
parent225bc32a989d7a22fa6addafd4ce7dcd04675dbf
add: don't write objects with --dry-run

When the option --dry-run/-n is given, "git add" doesn't change the
index, but still writes out new object files.  Only hash the latter
without writing instead to make the run as dry as possible.

Use this opportunity to also make the hash_flags variable unsigned,
to match the index_path() parameter it is used as.

Reported-by: git.mexon@spamgourmet.com
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
read-cache.c
t/t2200-add-update.sh