Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switching branches while there are uncomitted changes says Error but switches anyway #181

Closed
hamishcampbell opened this issue Jul 31, 2020 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@hamishcampbell
Copy link
Member

$ sno --version
Sno v0.4.2.dev0+ci.660.gitdb77ba8e, Copyright (c) Sno Contributors
» GDAL v3.0.3
» PyGit2 v1.1.0; Libgit2 v0.99.0; Git v2.27.0
» APSW v3.32.2-r1; SQLite v3.32.1; SpatiaLite v4.3.0a; Libpq v12.0.3
» SpatialIndex v1.9.3

If you have a multi-branch repo with uncommitted working copy changes, Sno appears to prevent switching branches, displaying an error:

$ sno checkout master
Updating my-data.gpkg ...
commit=36d385a54610216921ef23276932e4286ee9b64e head_ref=refs/heads/master
Error: You have uncommitted changes in your working copy. Commit or use --force to discard.

However the active branch is still switched, which is surprising. This should have rejected the switch and returned the repo to it's original state.

Full example. Note that branch change.

$ sno status
On branch other-branch

Changes in working copy:
  (use "sno commit" to commit)
  (use "sno reset" to discard changes)

  nz_chatham_island_road_centrelines_topo_1250k:
    feature:
      1 inserts

$ sno checkout master
Updating layer-50141.gpkg ...
commit=36d385a54610216921ef23276932e4286ee9b64e head_ref=refs/heads/master
Error: You have uncommitted changes in your working copy. Commit or use --force to discard.

$ sno status
On branch master
Your branch is up to date with 'origin/master'.

Changes in working copy:
  (use "sno commit" to commit)
  (use "sno reset" to discard changes)

  nz_chatham_island_road_centrelines_topo_1250k:
    feature:
      1 inserts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants