PTU5KAS/kas
Abdur Rehman 5b85fba0df repos: use git diff-index to check if repo is dirty
is_dirty_cmd() uses `git diff --shortstat` to see if the repo can be
safely checked out. This only checks for the modified files and does
not take the cached(staged) files into account.

There can be cases where the cached changes could be overwritten by a
checkout. In this case, the git checkout command aborts with an error
message telling the user to commit or stash their changes.

Use `git diff-index HEAD --shortstat` to determine if there are any
changes in the tracked files, whether cached or not.

https://git-scm.com/docs/git-diff-index

Signed-off-by: Abdur Rehman <abdur_rehman@mentor.com>
2018-04-03 11:39:37 +02:00
..
__init__.py config: Added schema validation for configuration files 2017-10-13 14:11:10 +02:00
__main__.py entry: Consistently call python3 2017-08-31 22:31:41 +02:00
__version__.py implements patch support for repos 2018-03-09 09:59:07 +01:00
build.py implements patch support for repos 2018-03-09 09:59:07 +01:00
config.py Revert "kas/config: Make 'get_repo_dict' private" 2018-03-26 14:49:06 +02:00
configschema.py implements patch support for repos 2018-03-09 09:59:07 +01:00
includehandler.py includehandler: Fix string formating issue 2018-01-02 14:26:46 +01:00
kas.py kas: added version output when starting kas 2017-10-19 17:15:26 +02:00
libcmds.py kas/libcmd: Instead of copying the .gitconfig, create a new dummy one 2018-03-21 17:16:04 +01:00
libkas.py implements patch support for repos 2018-03-09 09:59:07 +01:00
repos.py repos: use git diff-index to check if repo is dirty 2018-04-03 11:39:37 +02:00
shell.py implements patch support for repos 2018-03-09 09:59:07 +01:00