diff options
author | Boris Nagaev <bnagaev@gmail.com> | 2016-02-28 10:51:19 (GMT) |
---|---|---|
committer | Boris Nagaev <bnagaev@gmail.com> | 2016-04-20 20:35:13 (GMT) |
commit | ea511c193cd74b9cd6fae46c6745e38df4c4acb4 (patch) | |
tree | 163c40ffffb9b9a1b228b7d0169daeb76d90c3e9 | |
parent | 732169d86a0ea74e8a4fa75bc6fae18e10a0aeb3 (diff) | |
download | mxe-ea511c193cd74b9cd6fae46c6745e38df4c4acb4.zip mxe-ea511c193cd74b9cd6fae46c6745e38df4c4acb4.tar.gz mxe-ea511c193cd74b9cd6fae46c6745e38df4c4acb4.tar.bz2 |
build-pkg: use "git add" with --all
From the warning produced by "git add ." after removing a file with "rm":
> warning: You ran 'git add' with neither '-A (--all)' or '--ignore-removal',
> whose behaviour will change in Git 2.0 with respect to paths you removed.
> Paths like 'foo.txt' that are
> removed from your working tree are ignored with this version of Git.
>
> * 'git add --ignore-removal <pathspec>', which is the current default,
> ignores paths you removed from your working tree.
>
> * 'git add --all <pathspec>' will let you also record the removals.
>
> Run 'git status' to check the paths you removed from your working tree.
$ git status --porcelain
D foo.txt
$ git add --all .
$ git status --porcelain
D foo.txt
$ git --version
git version 1.9.1
-rwxr-xr-x | tools/build-pkg.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/build-pkg.lua b/tools/build-pkg.lua index 81b0391..b3fa217 100755 --- a/tools/build-pkg.lua +++ b/tools/build-pkg.lua @@ -430,7 +430,7 @@ local function gitCheckout(new_branch, deps, item2index, pass_of_deps) end local function gitAdd() - os.execute(GIT .. 'add .') + os.execute(GIT .. 'add --all .') end -- return two lists of filepaths under ./usr/ @@ -442,6 +442,7 @@ local function gitStatus() local git_st = io.popen(GIT .. 'status --porcelain', 'r') for line in git_st:lines() do local status, file = line:match('(..) (.*)') + assert(status:sub(2, 2) == ' ') status = trim(status) if file:sub(1, 1) == '"' then -- filename with a space is quoted by git |