forked from floatplane/git_pr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix floatplane#29 - log better info when a branch's tracking info isn…
…'t set.
- Loading branch information
1 parent
0debb9c
commit 0430fe7
Showing
1 changed file
with
16 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -301,7 +301,22 @@ when "open" | |
remote = git.find_remote_for_local_branch source | ||
remote_url = remote ? remote.url : nil | ||
unless remote_url and remote_url.match /github\.com/ | ||
puts "Branch '#{source}' has never been pushed to GitHub." | ||
puts <<EOS | ||
Branch '#{source}' has never been pushed to GitHub, | ||
or was pushed without setting the upstream branch. | ||
To fix this problem, try running: | ||
git branch --set-upstream-to=<your_remote>/#{source} #{source} | ||
In the future, you can avoid this problem by making your first push | ||
with the --set-upstream argument(or the shorthand, -u): | ||
git push --set-upstream <your_remote> #{source} | ||
git push -u <your_remote> #{source} | ||
EOS | ||
exit -1 | ||
end | ||
github_source_owner = remote_url.match(/[email protected]:(.*)\//)[1] | ||
|