FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

remote: Handle missing config values when deleting a remote by novalis · Pull Request #3862 · libgit2/libgit2 · GitHub

Repository navigation

remote: Handle missing config values when deleting a remote - #3862

Merged
ethomson merged 1 commit into
libgit2:masterfrom
novalis:dturner/do-not-die-on-missing-config
Jul 24, 2016
Merged

ethomson merged 1 commit into
libgit2:masterfrom
novalis:dturner/do-not-die-on-missing-config

Conversation

novalis commented Jul 15, 2016

Copy link
Copy Markdown
Contributor

Somehow I ended up with the following in my ~/.gitconfig:
[branch "master"]
remote = origin
merge = master
rebase = true

I assume something went crazy while I was running the git.git tests
some time ago, and that I never noticed until now.

This is not a good configuration, but it shouldn't cause problems. But
it does. Specifically, if you have this in your config, and you
perform the following set of actions:

create a remote
fetch from that remote
create a branch off of the remote master branch called "master"
delete the branch
delete the remote

The remote delete fails with the message "Could not find key
'branch.master.rebase' to delete". This is because it's iterating over
the config entries (including the ones in the global config) and
believes that there is a master branch which must therefore have these
config keys.

#3856

Comment thread src/remote.c
break;
if ((error = git_config_delete_entry(config, git_buf_cstr(&buf))) < 0) {
if (error != GIT_ENOTFOUND)
break;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Could I trouble you to do a giterr_clear() here to remove the error message that git_config_delete_entry added? We would like to avoid leaving that error message hanging around when there isn't actually an error.

Copy link
Copy Markdown
Member

👍 Thanks. :D

Somehow I ended up with the following in my ~/.gitconfig:
[branch "master"]
remote = origin
merge = master
rebase = true

I assume something went crazy while I was running the git.git tests
some time ago, and that I never noticed until now.

This is not a good configuration, but it shouldn't cause problems. But
it does. Specifically, if you have this in your config, and you
perform the following set of actions:

create a remote
fetch from that remote
create a branch off of the remote master branch called "master"
delete the branch
delete the remote

The remote delete fails with the message "Could not find key
'branch.master.rebase' to delete". This is because it's iterating over
the config entries (including the ones in the global config) and
believes that there is a master branch which must therefore have these
config keys.

libgit2#3856
novalis force-pushed the dturner/do-not-die-on-missing-config branch from ad971b5 to d81cb2e Compare July 15, 2016 17:47

novalis commented Jul 18, 2016

Copy link
Copy Markdown
Contributor Author

(done)

ethomson merged commit 76cfdd4 into libgit2:master Jul 24, 2016

Copy link
Copy Markdown
Member

Thanks!

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL