فهرست منبع

[git-freeze] Fix error in git-add invocation when not in repo root.

The previous change to git-freeze added an accidental regression
where running `git freeze` from somewhere other than the repo root
would return a mysterious error:

  "Failed to index some unindexed files. Nothing to freeze."

This is because `git add` always treats pathspecs as relative to the
current working directory. Fix this by changing `git add` to always
run from the repo root.

R=ajp@google.com

Change-Id: I451f26fe35a5c6e9f3b917a1d90bdadc7065244c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4703128
Commit-Queue: Andy Perelson <ajp@google.com>
Reviewed-by: Andy Perelson <ajp@google.com>
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
Robert Iannucci 2 سال پیش
والد
کامیت
2f0147a57a
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      git_common.py

+ 2 - 1
git_common.py

@@ -496,7 +496,8 @@ def freeze():
           '--pathspec-from-file',
           '-',
           '--ignore-errors',
-          indata=b'\n'.join(unindexed))
+          indata=b'\n'.join(unindexed),
+          cwd=root_path)
     except subprocess2.CalledProcessError:
       add_errors = True