• Andrii Shyshkalov's avatar
    Fix git cl on windows for git-numberer repos. · 351c61da
    Andrii Shyshkalov authored
    Git cl decides if git-numberer is enabled on a repository by writing
    Gerrit's project.config from refs/meta/config into a tempfile, which is
    then queried using `git config -f tempfile --get ...`.  The file itself
    is only flushed, but not closed after writing because Python's
    tempfile.NamedTemporaryFile is deleted on closing. This worked fine on
    Linix/Mac, but not on Windows, where `git config` apparently doesn't see
    file or its contents.
    
    This CL rewrites the above using yet another contexmanager temp
    directory into which a file is written and closed before git config is
    ran.
    
    R=machenbach@chromium.org,grt@chromium.org
    BUG=683202
    
    Change-Id: I7974d66b1b2b0478ab4b6f7ac04e547a4981c46c
    Reviewed-on: https://chromium-review.googlesource.com/430719
    Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
    Reviewed-by: 's avatarVadim Shtayura <vadimsh@chromium.org>
    351c61da
gclient_utils.py 39.5 KB