##// END OF EJS Templates
subrepo: bare git repos considered dirty...
Paul Molodowitch -
r14440:96f1c1b1 default
parent child Browse files
Show More
@@ -761,6 +761,9 b' class gitsubrepo(abstractsubrepo):'
761 base = self._gitcommand(['merge-base', r1, r2])
761 base = self._gitcommand(['merge-base', r1, r2])
762 return base == r1
762 return base == r1
763
763
764 def _gitisbare(self):
765 return self._gitcommand(['config', '--bool', 'core.bare']) == 'true'
766
764 def _gitbranchmap(self):
767 def _gitbranchmap(self):
765 '''returns 2 things:
768 '''returns 2 things:
766 a map from git branch to revision
769 a map from git branch to revision
@@ -823,6 +826,8 b' class gitsubrepo(abstractsubrepo):'
823 def dirty(self, ignoreupdate=False):
826 def dirty(self, ignoreupdate=False):
824 if self._gitmissing():
827 if self._gitmissing():
825 return True
828 return True
829 if self._gitisbare():
830 return True
826 if not ignoreupdate and self._state[1] != self._gitstate():
831 if not ignoreupdate and self._state[1] != self._gitstate():
827 # different version checked out
832 # different version checked out
828 return True
833 return True
@@ -834,7 +839,7 b' class gitsubrepo(abstractsubrepo):'
834 source, revision, kind = state
839 source, revision, kind = state
835 self._fetch(source, revision)
840 self._fetch(source, revision)
836 # if the repo was set to be bare, unbare it
841 # if the repo was set to be bare, unbare it
837 if self._gitcommand(['config', '--bool', 'core.bare']) == 'true':
842 if self._gitisbare():
838 self._gitcommand(['config', 'core.bare', 'false'])
843 self._gitcommand(['config', 'core.bare', 'false'])
839 if self._gitstate() == revision:
844 if self._gitstate() == revision:
840 self._gitcommand(['reset', '--hard', 'HEAD'])
845 self._gitcommand(['reset', '--hard', 'HEAD'])
General Comments 0
You need to be logged in to leave comments. Login now