Skip to content
  • Katsunori FUJIWARA's avatar
    context: avoid breaking already fixed self._status at ctx.status() · 1e6fb8db666e
    Katsunori FUJIWARA authored
    Before this patch, "status()" on "workingcommitctx" with "always
    match" object causes breaking "self._status" in
    "workingctx._buildstatus()", because "workingctx._buildstatus()"
    caches the result of "dirstate.status()" into "self._status" for
    efficiency, even though it should be fixed at construction for
    committing.
    
    For example, template function "diff()" without any patterns in
    "committemplate" implies "status()" on "workingcommitctx" with "always
    match" object, via "basectx.diff()" and "patch.diff()".
    
    Then, broken "self._status" causes committing unexpected files.
    
    To avoid breaking already fixed "self._status" at "ctx.status()", this
    patch overrides "_buildstatus" in "workingcommitctx".
    
    This patch doesn't write out the result of template function "diff()"
    in "committemplate" in "test-commit.t", because matching against files
    to be committed still has an issue fixed in subsequent patch.
    1e6fb8db666e