##// END OF EJS Templates
subrepo: fix git status false positive (issue3109)...
Eric Roshan Eisner -
r15531:0810ccc5 stable
parent child Browse files
Show More
@@ -807,6 +807,12 b' class gitsubrepo(abstractsubrepo):'
807 807 def _gitisbare(self):
808 808 return self._gitcommand(['config', '--bool', 'core.bare']) == 'true'
809 809
810 def _gitupdatestat(self):
811 """This must be run before git diff-index.
812 diff-index only looks at changes to file stat;
813 this command looks at file contents and updates the stat."""
814 self._gitcommand(['update-index', '-q', '--refresh'])
815
810 816 def _gitbranchmap(self):
811 817 '''returns 2 things:
812 818 a map from git branch to revision
@@ -876,6 +882,7 b' class gitsubrepo(abstractsubrepo):'
876 882 # different version checked out
877 883 return True
878 884 # check for staged changes or modified files; ignore untracked files
885 self._gitupdatestat()
879 886 out, code = self._gitdir(['diff-index', '--quiet', 'HEAD'])
880 887 return code == 1
881 888
@@ -983,6 +990,7 b' class gitsubrepo(abstractsubrepo):'
983 990 source, revision, kind = state
984 991 self._fetch(source, revision)
985 992 base = self._gitcommand(['merge-base', revision, self._state[1]])
993 self._gitupdatestat()
986 994 out, code = self._gitdir(['diff-index', '--quiet', 'HEAD'])
987 995
988 996 def mergefunc():
@@ -1090,6 +1098,7 b' class gitsubrepo(abstractsubrepo):'
1090 1098 # if the repo is missing, return no results
1091 1099 return [], [], [], [], [], [], []
1092 1100 modified, added, removed = [], [], []
1101 self._gitupdatestat()
1093 1102 if rev2:
1094 1103 command = ['diff-tree', rev1, rev2]
1095 1104 else:
@@ -361,6 +361,15 b" Don't crash if the .hgsubstate entry is "
361 361 $ hg update -qC nosubstate
362 362 $ ls s
363 363
364 issue3109: false positives in git diff-index
365
366 $ hg update -q
367 $ touch -t 200001010000 s/g
368 $ hg status --subrepos
369 $ touch -t 200001010000 s/g
370 $ hg sum | grep commit
371 commit: (clean)
372
364 373 Check hg update --clean
365 374 $ cd $TESTTMP/ta
366 375 $ echo > s/g
General Comments 0
You need to be logged in to leave comments. Login now