def test_unstage_paths_init(self): """Test unstage_paths() on the root commit.""" gitcmds.unstage_paths(self.context, ['A']) self.model.update_status() self.assertTrue('A' not in self.model.staged) self.assertTrue('A' in self.model.untracked)
def test_unstage_paths_init(self): """Test unstage_paths() on the root commit.""" gitcmds.unstage_paths(["A"]) self.model.update_status() self.assertTrue("A" not in self.model.staged) self.assertTrue("A" in self.model.untracked)
def test_unstage_paths(self): """Test a simple usage of unstage_paths().""" self.commit_files() self.write_file('A', 'change') self.git('add', 'A') gitcmds.unstage_paths(['A']) self.model.update_status() self.assertTrue('A' not in self.model.staged) self.assertTrue('A' in self.model.modified)
def test_unstage_paths(self): """Test a simple usage of unstage_paths().""" self.commit_files() self.write_file('A', 'change') self.git('add', 'A') gitcmds.unstage_paths(self.context, ['A']) self.model.update_status() self.assertTrue('A' not in self.model.staged) self.assertTrue('A' in self.model.modified)
def test_unstage_paths_subdir(self): """Test unstage_paths() in a subdirectory.""" self.git('commit', '-m', 'initial commit') core.makedirs('foo/bar') self.touch('foo/bar/baz') self.git('add', 'foo/bar/baz') gitcmds.unstage_paths(['foo']) self.model.update_status() self.assertTrue('foo/bar/baz' in self.model.untracked) self.assertTrue('foo/bar/baz' not in self.model.staged)
def test_unstage_paths_subdir(self): """Test unstage_paths() in a subdirectory.""" self.git('commit', '-m', 'initial commit') core.makedirs('foo/bar') self.touch('foo/bar/baz') self.git('add', 'foo/bar/baz') gitcmds.unstage_paths(self.context, ['foo']) self.model.update_status() self.assertTrue('foo/bar/baz' in self.model.untracked) self.assertTrue('foo/bar/baz' not in self.model.staged)
def test_unstage_paths(self): """Test a simple usage of unstage_paths().""" self.shell(""" git commit -m'initial commit' > /dev/null echo change > A && git add A """) gitcmds.unstage_paths(['A']) self.model.update_status() self.assertTrue('A' not in self.model.staged) self.assertTrue('A' in self.model.modified)
def test_unstage_paths_subdir(self): """Test unstage_paths() in a subdirectory.""" self.shell("git commit -m'initial commit' > /dev/null") self.shell(""" mkdir -p foo/bar && touch foo/bar/baz && git add foo/bar/baz """) gitcmds.unstage_paths(['foo']) self.model.update_status() self.assertTrue('foo/bar/baz' in self.model.untracked) self.assertTrue('foo/bar/baz' not in self.model.staged)
def unstage_paths(self, paths): if not paths: self.reset() return gitcmds.unstage_paths(paths, head=self.head) self.update_file_status()
def unstage_paths(self, paths): if not paths: self.unstage_all() return gitcmds.unstage_paths(paths, head=self.head) self.update_file_status()
def do(self): msg = 'Unstaging: %s' % (', '.join(self.paths)) _notifier.broadcast(signals.log_cmd, 0, msg) gitcmds.unstage_paths(self.paths) self.model.update_status()