Skip to content

How do you check for differences? #1159

Answered by jamesgeddes
jamesgeddes asked this question in Q&A
Discussion options

You must be logged in to vote

Found the problem! I was doing the pull in the wrong place.

    current = repo.head.commit

    repo.remotes.origin.pull()

    if current == repo.head.commit:
        print("Repo not changed. Sleep mode activated.")
        return 0
    else:
        print("Repo changed! Activated.")
        return 1

Not sure if this is the best way to do it, but it appears to work. Would still be grateful of any guidance.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Byron
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1040 on February 26, 2021 11:18.