summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--project.py21
1 files changed, 18 insertions, 3 deletions
diff --git a/project.py b/project.py
index 1bcd9596..956f45bf 100644
--- a/project.py
+++ b/project.py
@@ -283,7 +283,7 @@ class Project(object):
283 return os.path.exists(os.path.join(g, 'rebase-apply')) \ 283 return os.path.exists(os.path.join(g, 'rebase-apply')) \
284 or os.path.exists(os.path.join(g, 'rebase-merge')) \ 284 or os.path.exists(os.path.join(g, 'rebase-merge')) \
285 or os.path.exists(os.path.join(w, '.dotest')) 285 or os.path.exists(os.path.join(w, '.dotest'))
286 286
287 def IsDirty(self, consider_untracked=True): 287 def IsDirty(self, consider_untracked=True):
288 """Is the working directory modified in some way? 288 """Is the working directory modified in some way?
289 """ 289 """
@@ -416,7 +416,7 @@ class Project(object):
416 416
417 try: f = df[p] 417 try: f = df[p]
418 except KeyError: f = None 418 except KeyError: f = None
419 419
420 if i: i_status = i.status.upper() 420 if i: i_status = i.status.upper()
421 else: i_status = '-' 421 else: i_status = '-'
422 422
@@ -601,6 +601,18 @@ class Project(object):
601 if not self._RemoteFetch(): 601 if not self._RemoteFetch():
602 return False 602 return False
603 603
604 #Check that the requested ref was found after fetch
605 #
606 try:
607 self.GetRevisionId()
608 except ManifestInvalidRevisionError:
609 # if the ref is a tag. We can try fetching
610 # the tag manually as a last resort
611 #
612 rev = self.revisionExpr
613 if rev.startswith(R_TAGS):
614 self._RemoteFetch(None, rev[len(R_TAGS):])
615
604 if self.worktree: 616 if self.worktree:
605 self._InitMRef() 617 self._InitMRef()
606 else: 618 else:
@@ -982,7 +994,7 @@ class Project(object):
982 994
983## Direct Git Commands ## 995## Direct Git Commands ##
984 996
985 def _RemoteFetch(self, name=None): 997 def _RemoteFetch(self, name=None, tag=None):
986 if not name: 998 if not name:
987 name = self.remote.name 999 name = self.remote.name
988 1000
@@ -994,6 +1006,9 @@ class Project(object):
994 if not self.worktree: 1006 if not self.worktree:
995 cmd.append('--update-head-ok') 1007 cmd.append('--update-head-ok')
996 cmd.append(name) 1008 cmd.append(name)
1009 if tag is not None:
1010 cmd.append('tag')
1011 cmd.append(tag)
997 return GitCommand(self, 1012 return GitCommand(self,
998 cmd, 1013 cmd,
999 bare = True, 1014 bare = True,