Failure for `git add -A` in git-branch-push.ps1 does not result in commit
- Dominant language
- C#
- Stars
- 135
- Forks
- 260
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 143
Description
When the [`git add -A` step](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/scripts/git-branch-push.ps1#L157) in `git-branch-push.ps1` fails, no commit takes place but `git push` is attempted again... When pushing no new commits the `git push` command succeeds and the `git-branch-push.ps1` script exits with success.
This hides a failure mode where the modified files are not pushed to the branch but the script succeeds.
In this case, the problem is caused by files which are outside of the sparse checkout cone. A couple of options here:
* Treat a failure to `git add -A` as a terminal failure and exit the script with a nonzero exit code
* Attempt to commit files which are outside of the sparse checkout cone using `--sparse` in the `git add` command (behavior here unknown, but could result in bad behavior downstream.. this requires further investigation)
Contributor guide
Assessment
This issue has not been assessed yet.