gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1739544 - /gump/live/python/gump/core/update/git.py
Date Sun, 17 Apr 2016 04:32:50 GMT
Author: bodewig
Date: Sun Apr 17 04:32:50 2016
New Revision: 1739544

URL: http://svn.apache.org/viewvc?rev=1739544&view=rev
Log:
add git reset post-processing

Modified:
    gump/live/python/gump/core/update/git.py

Modified: gump/live/python/gump/core/update/git.py
URL: http://svn.apache.org/viewvc/gump/live/python/gump/core/update/git.py?rev=1739544&r1=1739543&r2=1739544&view=diff
==============================================================================
--- gump/live/python/gump/core/update/git.py (original)
+++ gump/live/python/gump/core/update/git.py Sun Apr 17 04:32:50 2016
@@ -98,17 +98,26 @@ class GitUpdater(ScmUpdater):
 
     def getPostProcessCommands(self, module, isUpdate):
         """
-        Run git submodule update --init if this has been an update,
-        if it has been a clone command just before, its recursive flag
+        Run git submodule update --init and git reset --hard if this
+        has been an update.
+        If it has been a clone command just before, its recursive flag
         will already have taken care of everything.
         """
         if isUpdate:
-            cmd = Cmd('git', 'submodule_update_' + module.getName(), 
+            subs = Cmd('git', 'submodule_update_' + module.getName(), 
                       module.getSourceControlStagingDirectory())
-            cmd.addParameter('submodule')
-            cmd.addParameter('update')
-            cmd.addParameter('--init')
-            cmd.addParameter('--recursive')
-            maybe_make_quiet(module, cmd)
-            return [cmd]
+            subs.addParameter('submodule')
+            subs.addParameter('update')
+            subs.addParameter('--init')
+            subs.addParameter('--recursive')
+            maybe_make_quiet(module, subs)
+
+            # git reset --hard so changed .gitattributes are applied
+            rst = Cmd('git', 'reset_hard_' + module.getName(), 
+                      module.getSourceControlStagingDirectory())
+            rst.addParameter('reset')
+            rst.addParameter('--hard')
+            rst.addParameter('origin/' + module.getScm().getBranch())
+            maybe_make_quiet(module, rst)
+            return [subs, rst]
         return []



Mime
View raw message