Skip to content

Commit

Permalink
fix sync
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Refalo committed Mar 5, 2013
1 parent 142f547 commit aeb7e8c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmds/g2-g2isforced.sh
@@ -1,13 +1,13 @@
#!/bin/bash #!/bin/bash
# #
# returns 1 if the given branch was force updated, 0 if not # returns 0 if the given branch was force updated, 1 if not
# if no parameters, figures the upstream branch from the tracking table # if no parameters, figures the upstream branch from the tracking table


remote=$1 remote=$1
[[ -z $1 ]] && remote=$("$GIT_EXE" g2getremote) [[ -z $1 ]] && remote=$("$GIT_EXE" g2getremote)
[[ -n $remote ]] && { [[ -n $remote ]] && {
hash=$("$GIT_EXE" reflog $remote | head -1 | grep forced-update | cut -f 1 -d " ") hash=$("$GIT_EXE" reflog $remote | head -1 | grep forced-update | cut -f 1 -d " ")
branch=$("$GIT_EXE" branch | grep "*" | sed "s/* //") branch=$("$GIT_EXE" branch | grep "*" | sed "s/* //")
[[ -n $hash && $("$GIT_EXE" reflog $branch | grep $hash | grep -c reset) -eq 0 ]] && exit 1 [[ -n $hash && $("$GIT_EXE" reflog $branch | grep $hash | grep -c reset) -eq 0 ]] && exit 0
} }
exit 0 exit 1

0 comments on commit aeb7e8c

Please sign in to comment.