Thread (3 messages) 3 messages, 2 authors, 2016-06-15

Re: [PATCH 2/2] reset: support "--mixed --intent-to-add" mode

From: Duy Nguyen <hidden>
Date: 2016-06-15 22:59:50

Possibly related (same subject, not in this thread)

On Thu, Feb 6, 2014 at 1:25 AM, Junio C Hamano [off-list ref] wrote:
quoted
Yes, indeed.  I wonder why your new test did not notice it, though
;-)
... and the answer turns out to be that it was not testing the right
thing.  On top of that faulty version, this will fix it.
Yes, write-tree should test that well.
Your suggestion to move CE_INTENT_TO_ADD to mark-intent-to-add makes
sense but a caller needs to be adjusted to drop the duplicated flag
manipulation.
No no. I found that duplicate, but I did not suggest removing it
because it is needed there..
quoted hunk ↗ jump to hunk
@@ -613,8 +614,6 @@ int add_to_index(struct index_state *istate, const char *path, struct stat *st,
        ce->ce_namelen = namelen;
        if (!intent_only)
                fill_stat_cache_info(ce, st);
-       else
-               ce->ce_flags |= CE_INTENT_TO_ADD;

        if (trust_executable_bit && has_symlinks)
                ce->ce_mode = create_ce_mode(st_mode);
A few lines down, there's ie_match_stat() call that will check
CE_INTENT_TO_ADD and returns "changed" immediately without looking at
stat data. If stat info is used, it may (not so sure) return "not
changed", the exit path is taken and mark_intent_to_add() is ignored.
-- 
Duy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help