* If we add a filename that aliases in the cache, we will use the * name that we already have - but we don't want to update the same * alias twice, because that implies that there were actually two * different files with aliasing names! * * So we use the CE_ADDED flag to verify that the alias was an old * one before we accept it as */
| 682 | * one before we accept it as |
| 683 | */ |
| 684 | static struct cache_entry *create_alias_ce(struct index_state *istate, |
| 685 | struct cache_entry *ce, |
| 686 | struct cache_entry *alias) |
| 687 | { |
| 688 | int len; |
| 689 | struct cache_entry *new_entry; |
| 690 | |
| 691 | if (alias->ce_flags & CE_ADDED) |
| 692 | die(_("will not add file alias '%s' ('%s' already exists in index)"), |
| 693 | ce->name, alias->name); |
| 694 | |
| 695 | /* Ok, create the new entry using the name of the existing alias */ |
| 696 | len = ce_namelen(alias); |
| 697 | new_entry = make_empty_cache_entry(istate, len); |
| 698 | memcpy(new_entry->name, alias->name, len); |
| 699 | copy_cache_entry(new_entry, ce); |
| 700 | save_or_free_index_entry(istate, ce); |
| 701 | return new_entry; |
| 702 | } |
| 703 | |
| 704 | void set_object_name_for_intent_to_add_entry(struct cache_entry *ce) |
| 705 | { |
no test coverage detected