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

Already on GitHub? Sign in to your account

Check for remote origin before sycing. #6

Merged
merged 1 commit into from May 10, 2012

Conversation

Projects
None yet
2 participants
Owner

throughnothing commented May 10, 2012

This will prevent errors when running simple commands if you only have a
local git repo setup ond don't have a remote origin to sync to.

@ironcamel ironcamel and 1 other commented on an outdated diff May 10, 2012

bin/notes
@@ -68,6 +68,11 @@ sub notes_dir { dir( $ENV{APP_NOTES_DIR} ) || dir( $ENV{HOME}, '.notes' ) }
sub notes_repo { file( notes_dir, '.git' ) }
sub auto_sync { $ENV{APP_NOTES_AUTOSYNC} // 1 }
+sub has_origin {
+ my ( $c ) = @_;
+ return grep { /^origin$/ } split ' ', $c->stash->{git}->run( 'remote' );
@ironcamel

ironcamel May 10, 2012

Contributor

Why are we checking for a remote named origin? Why not check for any remote?

@throughnothing

throughnothing May 10, 2012

Owner

Because git push and git pull require origin. And I don't want to get into allowing multiple non-origin remotes and allowing them to set what remote they want etc. origin is standard for git, and required.

Check for remote origin before sycing.
This will prevent errors when running simple commands
if you only have a local git repo setup ond don't have
a remote origin to sync to.
Contributor

ironcamel commented May 10, 2012

+1

throughnothing added a commit that referenced this pull request May 10, 2012

Merge pull request #6 from throughnothing/handle-no-origin
Check for remote origin before sycing.

@throughnothing throughnothing merged commit 55f045e into master May 10, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment