64studio / pdk

64 Studio Platform Development Kit
GNU General Public License v2.0
20 stars 8 forks source link

"pull" command fails late when uncomitted changes in workspace #43

Open obbardc opened 6 years ago

obbardc commented 6 years ago

We should check whether any uncommitted changes are present in the workspace before running the git fetch command.

$ pdk pull components

http://pdk.64studio.net/channels/debian/testing//etc/schema
|============================================================|
http://pdk.64studio.net/channels/debian/testing//etc/cache/blob_list.gz
|============================================================|
pdk INFO: Building channel index...
pdk INFO: Finished building channel index.
From http://pdk.64studio.net/channels/debian/testing//etc/git
 * [new branch]      master     -> components
pdk ERROR: Invalid input: Cannot merge with uncommitted changes in the workspace.
obbardc commented 6 years ago

This command should exit with code 0 if there are unstaged commits.

git diff-index --quiet HEAD -- || echo "unstaged commits!"