summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-12-03 08:23:34 +0000
committerZac Medico <zmedico@gentoo.org>2008-12-03 08:23:34 +0000
commitf23281325154b378fdbc15d4def5f0ab600607e6 (patch)
tree8503326211916d2d9c1297eb6b9182ca0aa1b303 /bin
parentWhen calling `git ls-files -m` to list modified files, use --with-tree=HEAD (diff)
downloadportage-multirepo-f23281325154b378fdbc15d4def5f0ab600607e6.tar.gz
portage-multirepo-f23281325154b378fdbc15d4def5f0ab600607e6.tar.bz2
portage-multirepo-f23281325154b378fdbc15d4def5f0ab600607e6.zip
It's not safe to use the git commit -a option since there might
be some modified files elsewhere in the working tree that the user doesn't want to commit. Therefore, call git update-index in order to ensure that the index is updated with the latest versions of all new and modified files in the relevant portion of the working tree. (trunk r12142) svn path=/main/branches/2.1.6/; revision=12143
Diffstat (limited to 'bin')
-rwxr-xr-xbin/repoman23
1 files changed, 23 insertions, 0 deletions
diff --git a/bin/repoman b/bin/repoman
index 9c4e1ad9..da3e4fcd 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1764,6 +1764,8 @@ else:
mymanifests.add(f)
else:
myupdates.add(f)
+ if vcs == 'git':
+ myupdates.difference_update(myremoved)
myupdates = list(myupdates)
mymanifests = list(mymanifests)
myheaders = []
@@ -2058,6 +2060,27 @@ else:
portage.writemsg("!!! Disabled FEATURES='sign'\n")
signed = False
+ if vcs == 'git':
+ # It's not safe to use the git commit -a option since there might
+ # be some modified files elsewhere in the working tree that the
+ # user doesn't want to commit. Therefore, call git update-index
+ # in order to ensure that the index is updated with the latest
+ # versions of all new and modified files in the relevant portion
+ # of the working tree.
+ myfiles = mymanifests + myupdates
+ myfiles.sort()
+ update_index_cmd = ["git", "update-index"]
+ update_index_cmd.extend(f.lstrip("./") for f in myfiles)
+ if options.pretend:
+ print "(%s)" % (" ".join(update_index_cmd),)
+ else:
+ retval = spawn(update_index_cmd, env=os.environ)
+ if retval != os.EX_OK:
+ writemsg_level(("!!! Exiting on %s (shell) " + \
+ "error code: %s\n") % (vcs, retval),
+ level=logging.ERROR, noiselevel=-1)
+ sys.exit(retval)
+
if vcs == 'git' or manifest_commit_required or signed:
myfiles = mymanifests[:]