• J
    Files given on the command line are relative to $cwd · dbd0f5c7
    Junio C Hamano 提交于
    When running "git commit -F file" and "git tag -F file" from a
    subdirectory, we should take it as relative to the directory we started
    from, not relative to the top-level directory.
    
    This adds a helper function "parse_options_fix_filename()" to make it more
    convenient to fix this class of issues.  Ideally, parse_options() should
    support a new type of option, "OPT_FILENAME", to do this uniformly, but
    this patch is meant to go to 'maint' to fix it minimally.
    
    One thing to note is that value for "commit template file" that comes from
    the command line is taken as relative to $cwd just like other parameters,
    but when it comes from the configuration varilable 'commit.template', it
    is taken as relative to the working tree root as before.  I think this
    difference actually is sensible (not that I particularly think
    commit.template itself is sensible).
    Signed-off-by: NJunio C Hamano <gitster@pobox.com>
    dbd0f5c7
t7500-commit.sh 4.3 KB