#3630 Use old-style checkout for shortened refs
Merged a year ago by tkopecek. Opened a year ago by tkopecek.
tkopecek/koji issue3629  into  master

file modified
+9 -2
@@ -521,6 +521,7 @@ 

          sourcedir = '%s/%s' % (scmdir, self.module)

  

          update_checkout_cmds = None

+         update_recovery_cmd = None

          update_checkout_dir = None

          env = None

  
@@ -587,6 +588,7 @@ 

                  ['git', 'fetch', 'origin', '%s:KOJI_FETCH_HEAD' % rev],

                  ['git', 'reset', '--hard', 'KOJI_FETCH_HEAD']

              ]

+             update_recovery_cmd = ['git', 'reset', '--hard', self.revision]

              update_checkout_dir = sourcedir

  

              # self.module may be empty, in which case the specfile should be in the top-level
@@ -625,6 +627,7 @@ 

                  ['git', 'fetch', 'origin', '%s:KOJI_FETCH_HEAD' % rev],

                  ['git', 'reset', '--hard', 'KOJI_FETCH_HEAD']

              ]

+             update_recovery_cmd = ['git', 'reset', '--hard', self.revision]

              update_checkout_dir = sourcedir

  

              # self.module may be empty, in which case the specfile should be in the top-level
@@ -667,8 +670,12 @@ 

                       chdir=update_checkout_dir, fatal=True)

                  _run(['git', 'config', 'core.safecrlf', 'true'],

                       chdir=update_checkout_dir, fatal=True)

-             for cmd in update_checkout_cmds:

-                 _run(cmd, chdir=update_checkout_dir, fatal=True)

+             try:

+                 for cmd in update_checkout_cmds:

+                     _run(cmd, chdir=update_checkout_dir, fatal=True)

+             except Exception:

+                 # use old-style checkout, e.g. for shortened refs

+                 _run(update_recovery_cmd, chdir=update_checkout_dir, fatal=True)

  

          if self.use_common and not globals().get('KOJIKAMID'):

              _run(common_checkout_cmd, chdir=scmdir, fatal=True)

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

a year ago

rebased onto be4e0cc

a year ago

Metadata Update from @jcupova:
- Pull-request tagged with: testing-done

a year ago

Commit d79c865 fixes this pull-request

Pull-Request has been merged by tkopecek

a year ago
Metadata