blob: ab33751a6351ca8d1e7f240cd768311414b97a7e [file] [log] [blame]
[email protected]cc51cd02010-12-23 00:48:391#!/bin/bash
2
[email protected]e84b7542012-06-15 21:26:583# Copyright (c) 2012 The Chromium Authors. All rights reserved.
4# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6
[email protected]cc51cd02010-12-23 00:48:397# Check that abandoning a branch also abandons its issue.
8
9set -e
10
11. ./test-lib.sh
12
13setup_initsvn
14setup_gitsvn
15
16(
17 set -e
18 cd git-svn
[email protected]626e77d2014-03-13 01:05:5819 git config rietveld.server localhost:10000
[email protected]cc51cd02010-12-23 00:48:3920
21 # Create a branch and give it an issue.
22 git checkout -q -b abandoned
23 echo "some work done on a branch" >> test
24 git add test; git commit -q -m "branch work"
[email protected]615a2622013-05-03 13:20:1425 export GIT_EDITOR=$(which true)
[email protected]cc51cd02010-12-23 00:48:3926 test_expect_success "upload succeeds" \
[email protected]1a5cb6e2011-03-14 20:11:2927 "$GIT_CL upload -m test master | grep -q 'Issue created'"
[email protected]cc51cd02010-12-23 00:48:3928
29 # Switch back to master, delete the branch.
30 git checkout master
31 git branch -D abandoned
32
33 # Verify that "status" doesn't know about it anymore.
34 # The "exit" trickiness is inverting the exit status of grep.
35 test_expect_success "git-cl status dropped abandoned branch" \
[email protected]8d1a14f2013-07-27 02:30:2636 "$GIT_CL_STATUS | grep -q abandoned && exit 1 || exit 0"
[email protected]cc51cd02010-12-23 00:48:3937)
38
39SUCCESS=$?
40
41cleanup
42
43if [ $SUCCESS == 0 ]; then
44 echo PASS
45fi