• Duy Nguyen's avatar
    unpack-trees.c: keep backup of ignored files being overwritten · d7242827
    Duy Nguyen authored
    Ignored files are usually machine generated (e.g. *.o) and not worth
    keeping, so when a merge or branch switch happens and need to
    overwrite them, we just go ahead and do it. Occasionally though
    ignored files _can_ have valuable content.
    We will likely have a separate mechanism to protect these "precious"
    ignored files, but a surprise is still a surprise. Keep a backup of
    ignored files when they are overwritten (until we are explicitly told
    "rubbish" by said mechanism). This lets the user recover the content
    and start telling git that the file is precious so it won't happen
merge.c 2.86 KB