Skip to contentSkip to conversation

Don't print "rebasing" if the head doesn't change

PATCH Applied Pavel Roskin 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Don't print "rebasing" if the head doesn't change

---
Please ignore previous version of this patch; it was buggy.
---

 stgit/commands/pull.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
stgit/commands/pull.py +4 -2
index b63ef7a..2d4a782 100644
@@ -73,8 +73,10 @@ def func(parser, options, args):
     print 'Pulling from "%s"...' % repository
     git.fetch(repository)
     if (config.get('stgit.pull-does-rebase') == 'yes'):
-        print 'rebasing to "%s"...' % git.fetch_head()
-        git.reset(tree_id = git.fetch_head())
+        fetch_head = git.fetch_head()
+        if fetch_head != git.get_head():
+            print 'rebasing to "%s"...' % fetch_head
+            git.reset(tree_id = fetch_head)
     print 'done'
 
     # push the patches back