Skip to content

Commit

Permalink
hot fix git fatal issue
Browse files Browse the repository at this point in the history
  • Loading branch information
rking32 committed Aug 30, 2020
1 parent 585bdf5 commit 25bf8e2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ dmypy.json
.pyre/

# config files
.apt/
.heroku/
.profile.d/
vendor/
config.ini
config.env
.vscode/
Expand Down
6 changes: 6 additions & 0 deletions userge/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ class Config:
logbot.del_last_msg()


for ref in _REPO.remote(Config.UPSTREAM_REMOTE).refs:
branch = str(ref).split('/')[-1]
if branch not in _REPO.branches:
_REPO.create_head(branch, ref)


def get_version() -> str:
""" get userge version """
ver = f"{versions.__major__}.{versions.__minor__}.{versions.__micro__}"
Expand Down
7 changes: 1 addition & 6 deletions userge/plugins/tools/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,11 @@ async def check_update(message: Message):
""" check or do updates """
await message.edit("`Checking for updates, please wait....`")
repo = Repo()
ups_rem = repo.remote(Config.UPSTREAM_REMOTE)
try:
ups_rem.fetch()
repo.remote(Config.UPSTREAM_REMOTE).fetch()
except GitCommandError as error:
await message.err(error, del_in=5)
return
for ref in ups_rem.refs:
branch = str(ref).split('/')[-1]
if branch not in repo.branches:
repo.create_head(branch, ref)
flags = list(message.flags)
pull_from_repo = False
push_to_heroku = False
Expand Down
2 changes: 1 addition & 1 deletion userge/plugins/utils/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
CHANNEL = userge.getCLogger(__name__)

FILTERS_DATA: Dict[int, Dict[str, int]] = {}
FILTERS_CHATS = filters.create(lambda _, __, query: query.chat.id in FILTERS_DATA)
FILTERS_CHATS = filters.create(lambda _, __, query: query.chat and query.chat.id in FILTERS_DATA)

_SUPPORTED_TYPES = (":audio:", ":video:", ":photo:", ":document:",
":sticker:", ":animation:", ":voice:", ":video_note:",
Expand Down

0 comments on commit 25bf8e2

Please sign in to comment.