aboutsummaryrefslogtreecommitdiff
path: root/builtin/checkout.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-10-14 10:50:07 -0700
committerJunio C Hamano <gitster@pobox.com>2014-10-14 10:50:07 -0700
commit145c590df8131abe510adde677eb3121cf52d31e (patch)
tree1bec212671aca326a5f966df97e159bc25ccdb79 /builtin/checkout.c
parent63434da0b4966894b5b812965cb3ada3d4101d6c (diff)
parente3f1da982e4f14e7146964cb25a5011a3f41e84a (diff)
downloadgit-145c590df8131abe510adde677eb3121cf52d31e.tar.gz
git-145c590df8131abe510adde677eb3121cf52d31e.tar.xz
Merge branch 'rs/more-uses-of-skip-prefix'
* rs/more-uses-of-skip-prefix: use skip_prefix() to avoid more magic numbers
Diffstat (limited to 'builtin/checkout.c')
-rw-r--r--builtin/checkout.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 570bb09c4..b4decd5b1 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -1150,10 +1150,8 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
const char *argv0 = argv[0];
if (!argc || !strcmp(argv0, "--"))
die (_("--track needs a branch name"));
- if (starts_with(argv0, "refs/"))
- argv0 += 5;
- if (starts_with(argv0, "remotes/"))
- argv0 += 8;
+ skip_prefix(argv0, "refs/", &argv0);
+ skip_prefix(argv0, "remotes/", &argv0);
argv0 = strchr(argv0, '/');
if (!argv0 || !argv0[1])
die (_("Missing branch name; try -b"));