diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-10-14 21:50:07 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-10-14 21:50:07 +0400 |
commit | 145c590df8131abe510adde677eb3121cf52d31e (patch) | |
tree | 1bec212671aca326a5f966df97e159bc25ccdb79 /builtin/checkout.c | |
parent | 63434da0b4966894b5b812965cb3ada3d4101d6c (diff) | |
parent | e3f1da982e4f14e7146964cb25a5011a3f41e84a (diff) |
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.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c index 570bb09c4f..b4decd5b19 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")); |